com.ibm.commerce.tools.campaigns
Class CampaignUtil

java.lang.Object
  |
  +--com.ibm.commerce.tools.campaigns.CampaignUtil

public class CampaignUtil
extends java.lang.Object

The CampaignUtil class provides some utility methods that are used by campaigns.


Field Summary
static java.lang.String COPYRIGHT
          Copyright.
 
Constructor Summary
CampaignUtil()
           
 
Method Summary
static java.lang.Integer getLanguageIdFromLocaleName(java.lang.String localeName)
          The getLanguageIdFromLocaleName method takes the locale, and returns the relative language ID.
static java.lang.String getLocaleNameFromLanguageId(java.lang.String languageId)
          The getLocaleNameFromLanguageId method takes the language ID, and returns the relative locale name.
static java.lang.String normalizeStringDate(java.lang.String stringDate)
          The normalizeStringDate method takes the date in string format, and normalize it.
static java.lang.String stripBrackets(java.lang.String s)
          The stripBrackets method takes the string, and removes its bracket wrapped around it.
static java.lang.String stripQuotes(java.lang.String s)
          The stripQuotes method takes the string, and removes its quotes wrapped around it.
static java.lang.String stripSingleQuotes(java.lang.String s)
          The stripSingleQuotes method takes the string, and removes its single quotes wrapped around it.
static java.lang.String substitute(java.lang.String message, int arg1)
          Substitutes message parameters with arguments.
static java.lang.String substitute(java.lang.String message, int arg1, int arg2)
          Substitutes message parameters with arguments.
static java.lang.String substitute(java.lang.String message, java.lang.Object[] arguments)
          Substitutes message parameters with arguments.
static java.lang.String substitute(java.lang.String message, java.lang.String arg1)
          Substitutes message parameters with arguments.
static java.lang.String substitute(java.lang.String message, java.lang.String arg1, java.lang.String arg2)
          Substitutes message parameters with arguments.
static java.math.BigDecimal toBigDecimal(java.lang.String value)
          Converts a string value to BigDecimal.
static boolean toBoolean(java.lang.String value)
          Converts a string value to boolean.
static java.lang.Integer toInteger(java.lang.String value)
          Converts a string value to Ingeger.
static java.lang.Long toLong(java.lang.String value)
          Converts a string value to Long.
static java.util.Vector toVector(java.lang.Object value)
          Converts an object to a Vector.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
Copyright.
Constructor Detail

CampaignUtil

public CampaignUtil()
Method Detail

getLanguageIdFromLocaleName

public static java.lang.Integer getLanguageIdFromLocaleName(java.lang.String localeName)
The getLanguageIdFromLocaleName method takes the locale, and returns the relative language ID.
Parameters:
localeName - The name of the locale.
Returns:
The language ID of the specified locale.

getLocaleNameFromLanguageId

public static java.lang.String getLocaleNameFromLanguageId(java.lang.String languageId)
The getLocaleNameFromLanguageId method takes the language ID, and returns the relative locale name.
Parameters:
languageId - The language ID.
Returns:
The name of the locale of the specified language ID.

normalizeStringDate

public static java.lang.String normalizeStringDate(java.lang.String stringDate)
The normalizeStringDate method takes the date in string format, and normalize it.
Parameters:
stringDate - The date string.
Returns:
The normalize date string.

stripBrackets

public static java.lang.String stripBrackets(java.lang.String s)
The stripBrackets method takes the string, and removes its bracket wrapped around it.
Parameters:
s - The string with brackets.
Returns:
The string without brackets.

stripQuotes

public static java.lang.String stripQuotes(java.lang.String s)
The stripQuotes method takes the string, and removes its quotes wrapped around it.
Parameters:
s - The string with quotes.
Returns:
The string without quotes.

stripSingleQuotes

public static java.lang.String stripSingleQuotes(java.lang.String s)
The stripSingleQuotes method takes the string, and removes its single quotes wrapped around it.
Parameters:
s - The string with single quotes.
Returns:
The string without single quotes.

substitute

public static java.lang.String substitute(java.lang.String message,
                                          int arg1)
Substitutes message parameters with arguments. Parameters are of the form {n}.
Parameters:
message - A text message with imbedded parameters.
arg1 - An argument.
Returns:
The message after substitution.

substitute

public static java.lang.String substitute(java.lang.String message,
                                          int arg1,
                                          int arg2)
Substitutes message parameters with arguments. Parameters are of the form {n}.
Parameters:
message - A text message with imbedded parameters.
arg1 - An argument.
arg2 - An argument.
Returns:
The message after substitution.

substitute

public static java.lang.String substitute(java.lang.String message,
                                          java.lang.Object[] arguments)
Substitutes message parameters with arguments. Parameters are of the form {n}.
Parameters:
message - A text message with imbedded parameters.
arguments - An array of arguments.
Returns:
The message after substitution.

substitute

public static java.lang.String substitute(java.lang.String message,
                                          java.lang.String arg1)
Substitutes message parameters with arguments. Parameters are of the form {n}.
Parameters:
message - A text message with imbedded parameters.
arg1 - An argument.
Returns:
The message after substitution.

substitute

public static java.lang.String substitute(java.lang.String message,
                                          java.lang.String arg1,
                                          java.lang.String arg2)
Substitutes message parameters with arguments. Parameters are of the form {n}.
Parameters:
message - A text message with imbedded parameters.
arg1 - An argument.
arg2 - An argument.
Returns:
The message after substitution.

toBigDecimal

public static java.math.BigDecimal toBigDecimal(java.lang.String value)
Converts a string value to BigDecimal.
Returns:
A BigDecimal object or null.

toBoolean

public static boolean toBoolean(java.lang.String value)
Converts a string value to boolean.
Returns:
true if the string is "true".

toInteger

public static java.lang.Integer toInteger(java.lang.String value)
Converts a string value to Ingeger.
Returns:
An Integer object or null.

toLong

public static java.lang.Long toLong(java.lang.String value)
Converts a string value to Long.
Returns:
A Long object or null.

toVector

public static java.util.Vector toVector(java.lang.Object value)
Converts an object to a Vector.
Returns:
A Vector object or null.