com.scooterframework.common.util
Class Util

java.lang.Object
  extended by com.scooterframework.common.util.Util

public class Util
extends java.lang.Object

Util class has helper methods not included in other util classes.


Constructor Summary
Util()
           
 
Method Summary
static int[] cloneArray(int[] array)
          Creates a copy of string array.
static java.lang.String[] cloneArray(java.lang.String[] array)
          Creates a copy of string array.
static java.lang.Object decode(int expression, java.util.Map<java.lang.String,java.lang.Object> searchResults, java.lang.Object defaultValue)
          decode method has the functionality of an IF-THEN-ELSE statement.
static java.lang.Object decode(int expression, java.lang.String searchResults, java.lang.Object defaultValue)
          decode method has the functionality of an IF-THEN-ELSE statement.
static java.lang.Object decode(long expression, java.util.Map<java.lang.String,java.lang.Object> searchResults, java.lang.Object defaultValue)
          decode method has the functionality of an IF-THEN-ELSE statement.
static java.lang.Object decode(long expression, java.lang.String searchResults, java.lang.Object defaultValue)
          decode method has the functionality of an IF-THEN-ELSE statement.
static java.lang.Object decode(java.lang.Object expression, java.util.Map<java.lang.String,?> searchResults, java.lang.Object defaultValue)
          decode method has the functionality of an IF-THEN-ELSE statement.
static java.lang.Object decode(java.lang.Object expression, java.util.Map<java.lang.String,?> searchResults, java.lang.Object defaultValue, boolean ignoreKeyCase)
          decode method has the functionality of an IF-THEN-ELSE statement.
static java.lang.Object decode(java.lang.Object expression, java.lang.String searchResults, java.lang.Object defaultValue)
          decode method has the functionality of an IF-THEN-ELSE statement.
static java.lang.Object decode(java.lang.Object expression, java.lang.String searchResults, java.lang.Object defaultValue, boolean ignoreKeyCase)
          decode method has the functionality of an IF-THEN-ELSE statement.
static boolean getBooleanValue(java.util.Map<java.lang.String,?> inputs, java.lang.String key, boolean defaultValue)
           
static boolean getBooleanValueForKey(java.util.Map<java.lang.String,?> inputs, java.lang.String key)
           
static java.util.Calendar getCalendar(java.lang.String dateString, java.lang.String format)
           
static java.util.Calendar getCalendar(java.lang.String dateString, java.lang.String format, java.util.TimeZone tz)
           
static java.lang.String getCurrencyDisplay(double amount)
           
static java.lang.String getCurrencyDisplay(java.lang.Object amount)
           
static java.util.Calendar getCurrentCalendarInGMT()
           
static java.util.Date getDate(java.lang.String dateString, java.lang.String format)
           
static java.util.Date getDate(java.lang.String dateString, java.lang.String format, java.util.TimeZone tz)
           
static java.lang.String getDateString(java.util.Date date, java.lang.String format)
           
static java.lang.String getFullClassName(java.lang.Class<?> c)
          returns the full class name
static int getIntValue(java.util.Map<java.lang.String,?> inputs, java.lang.String key, int defaultValue)
           
static int getIntValueForKey(java.util.Map<java.lang.String,?> inputs, java.lang.String key)
           
static long getLongValue(java.util.Map<java.lang.String,?> inputs, java.lang.String key, long defaultValue)
           
static long getLongValueForKey(java.util.Map<java.lang.String,?> inputs, java.lang.String key)
           
static java.lang.Character getSafeCharacter(java.lang.Object sValue)
          helper method used to safely acquire a Character from the first char of the input object.
static java.lang.Character getSafeCharacter(java.lang.String sValue)
          helper method used to safely acquire a Character from the first char of the input string.
static java.util.Date getSafeDate(java.util.Date date)
          helper method used to safely acquire a Date
static java.util.Date getSafeDate(java.lang.Object date)
          helper method used to safely acquire a Date
static java.lang.Double getSafeDouble(java.math.BigDecimal input)
          helper method used to safely acquire a Double object
static java.lang.Double getSafeDouble(java.lang.Object input)
          helper method used to safely acquire a Double object
static double getSafeDoubleValue(java.lang.Object input)
          helper method used to safely acquire a double value
static java.lang.Float getSafeFloat(java.math.BigDecimal input)
          helper method used to safely acquire a Float object
static java.lang.Float getSafeFloat(java.lang.Object input)
          helper method used to safely acquire a Float object
static float getSafeFloatValue(java.lang.Object input)
          helper method used to safely acquire a float value
static java.lang.Integer getSafeInteger(java.math.BigDecimal input)
          helper method used to safely acquire a Integer object
static java.lang.Integer getSafeInteger(java.lang.Object input)
          helper method used to safely acquire a Integer object
static int getSafeIntValue(java.lang.Object input)
          helper method used to safely acquire a int value
static java.lang.Long getSafeLong(java.math.BigDecimal input)
          helper method used to safely acquire a Long object
static java.lang.Long getSafeLong(java.lang.Object input)
          helper method used to safely acquire a Long object
static long getSafeLongValue(java.lang.Object input)
          helper method used to safely acquire a long value
static java.lang.String getSafeString(java.lang.Object input)
          helper method used to safely acquire a String
static java.lang.String getShortClassName(java.lang.Class<?> c)
          returns short version of class name.
static java.lang.String getShortClassNameInLowerCase(java.lang.Class<?> c)
          returns short version of class name.
static java.lang.String getStringValue(java.util.Map<java.lang.String,?> inputs, java.lang.String key, java.lang.String defaultValue)
           
static java.lang.String getStringValueForKey(java.util.Map<java.lang.String,?> inputs, java.lang.String key)
           
static java.sql.Timestamp getTimestamp(java.lang.String dateString, java.lang.String format)
           
static java.util.Calendar getTomorrowCalendar()
           
static java.lang.Object ifEmpty(java.lang.Object value, java.lang.Object substituteWhenEmpty)
          ifEmpty method lets you substitute a value when an empty value is encountered.
static java.lang.Object ifEmpty(java.lang.Object value, java.lang.Object substituteWhenNotEmpty, java.lang.Object substituteWhenEmpty)
          ifEmpty method lets you substitute a value when an empty value is encountered as well as when a non-null value is encountered.
static java.lang.Object ifNull(java.lang.Object value, java.lang.Object substituteWhenNull)
          ifNull method lets you substitute a value when a null value is encountered.
static java.lang.Object ifNull(java.lang.Object value, java.lang.Object substituteWhenNotNull, java.lang.Object substituteWhenNull)
          ifNull method lets you substitute a value when a null value is encountered as well as when a non-null value is encountered.
static java.lang.String ifNull(java.lang.String value, java.lang.String substituteWhenNull)
          ifNull method lets you substitute a value when a null value is encountered.
static java.lang.String ifNull(java.lang.String value, java.lang.String substituteWhenNotNull, java.lang.String substituteWhenNull)
          ifNull method lets you substitute a value when a null value is encountered as well as when a non-null value is encountered.
static java.lang.Object ifTrue(boolean state, java.lang.Object valueForTrue, java.lang.Object valueForFalse)
          ifTrue method lets you choose a value when a true value is encountered as well as when a false value is encountered.
static boolean isEmpty(java.lang.Object data)
          Checks if a data object is empty.
static boolean isInArray(java.lang.Object item, java.lang.Object[] items)
          Checks if an object exists in an array.
static boolean isInArray(java.lang.Object item, java.lang.Object[] items, boolean ignoreCase)
          Checks if an object exists in an array.
static java.lang.String md5(java.lang.String input)
          Returns a MD5 digest string of the input string.
static java.lang.Object nvl(java.lang.Object value, java.lang.Object substituteWhenNull)
          nvl method lets you substitute a value when a null value is encountered.
static java.lang.Object nvl(java.lang.Object value, java.lang.Object substituteWhenNotNull, java.lang.Object substituteWhenNull)
          nvl method lets you substitute a value when a null value is encountered as well as when a non-null value is encountered.
static java.lang.String nvl(java.lang.String value, java.lang.String substituteWhenNull)
          nvl method lets you substitute a value when a null value is encountered.
static java.lang.String nvl(java.lang.String value, java.lang.String substituteWhenNotNull, java.lang.String substituteWhenNull)
          nvl method lets you substitute a value when a null value is encountered as well as when a non-null value is encountered.
static java.util.Date parseDateByFormat(java.lang.String dateString, java.lang.String format)
           
static int sign(double number)
          Checks sign of a number.
static int sign(float number)
          Checks sign of a number.
static int sign(int number)
          Checks sign of a number.
static int sign(long number)
          Checks sign of a number.
static int sign(java.lang.Number number)
          Checks sign of a number.
static short sign(short number)
          Checks sign of a number.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Util

public Util()
Method Detail

sign

public static int sign(double number)
Checks sign of a number.
  If number < 0, then sign returns -1.
  If number = 0, then sign returns 0.
  If number > 0, then sign returns 1.
 

Parameters:
number - the number to test its sign.
Returns:
sign of a number

sign

public static int sign(float number)
Checks sign of a number.
  If number < 0, then sign returns -1.
  If number = 0, then sign returns 0.
  If number > 0, then sign returns 1.
 

Parameters:
number - the number to test its sign.
Returns:
sign of a number

sign

public static int sign(int number)
Checks sign of a number.
  If number < 0, then sign returns -1.
  If number = 0, then sign returns 0.
  If number > 0, then sign returns 1.
 

Parameters:
number - the number to test its sign.
Returns:
sign of a number

sign

public static int sign(long number)
Checks sign of a number.
  If number < 0, then sign returns -1.
  If number = 0, then sign returns 0.
  If number > 0, then sign returns 1.
 

Parameters:
number - the number to test its sign.
Returns:
sign of a number

sign

public static short sign(short number)
Checks sign of a number.
  If number < 0, then sign returns -1.
  If number = 0, then sign returns 0.
  If number > 0, then sign returns 1.
 

Parameters:
number - the number to test its sign.
Returns:
sign of a number

sign

public static int sign(java.lang.Number number)
Checks sign of a number.
  If number < 0, then sign returns -1.
  If number = 0, then sign returns 0.
  If number > 0, then sign returns 1.
 

Parameters:
number - the number to test its sign.
Returns:
sign of a number

decode

public static java.lang.Object decode(int expression,
                                      java.lang.String searchResults,
                                      java.lang.Object defaultValue)
decode method has the functionality of an IF-THEN-ELSE statement. See description in decode(Object expression, Map searchResults, Object defaultValue)

Parameters:
expression - the value to compare.
searchResults - a string of search and result pair.
defaultValue - default value if a search returns no match.
Returns:
result of decode

decode

public static java.lang.Object decode(int expression,
                                      java.util.Map<java.lang.String,java.lang.Object> searchResults,
                                      java.lang.Object defaultValue)
decode method has the functionality of an IF-THEN-ELSE statement. See description in decode(Object expression, Map searchResults, Object defaultValue)

Parameters:
expression - the value to compare.
searchResults - a map of search and result pair.
defaultValue - default value if a search returns no match.
Returns:
result of decode

decode

public static java.lang.Object decode(long expression,
                                      java.lang.String searchResults,
                                      java.lang.Object defaultValue)
decode method has the functionality of an IF-THEN-ELSE statement. See description in decode(Object expression, Map searchResults, Object defaultValue)

Parameters:
expression - the value to compare.
searchResults - a string of search and result pair.
defaultValue - default value if a search returns no match.
Returns:
result of decode

decode

public static java.lang.Object decode(long expression,
                                      java.util.Map<java.lang.String,java.lang.Object> searchResults,
                                      java.lang.Object defaultValue)
decode method has the functionality of an IF-THEN-ELSE statement. See description in decode(Object expression, Map searchResults, Object defaultValue)

Parameters:
expression - the value to compare.
searchResults - a map of search and result pair.
defaultValue - default value if a search returns no match.
Returns:
result of decode

decode

public static java.lang.Object decode(java.lang.Object expression,
                                      java.lang.String searchResults,
                                      java.lang.Object defaultValue)
decode method has the functionality of an IF-THEN-ELSE statement. See description in decode(Object expression, Map searchResults, Object defaultValue)

Parameters:
expression - the value to compare.
searchResults - a string of search and result pair.
defaultValue - default value if a search returns no match.
Returns:
result of decode

decode

public static java.lang.Object decode(java.lang.Object expression,
                                      java.lang.String searchResults,
                                      java.lang.Object defaultValue,
                                      boolean ignoreKeyCase)
decode method has the functionality of an IF-THEN-ELSE statement. See description in decode(Object expression, Map searchResults, Object defaultValue)

Parameters:
expression - the value to compare.
searchResults - a string of search and result pair.
defaultValue - default value if a search returns no match.
ignoreKeyCase - true if cases of keys in searchResults are ignored.
Returns:
result of decode

decode

public static java.lang.Object decode(java.lang.Object expression,
                                      java.util.Map<java.lang.String,?> searchResults,
                                      java.lang.Object defaultValue)
decode method has the functionality of an IF-THEN-ELSE statement. See description in decode(Object expression, Map searchResults, Object defaultValue)

Parameters:
expression - the value to compare.
searchResults - a map of search and result pair.
defaultValue - default value if a search returns no match.
Returns:
result of decode

decode

public static java.lang.Object decode(java.lang.Object expression,
                                      java.util.Map<java.lang.String,?> searchResults,
                                      java.lang.Object defaultValue,
                                      boolean ignoreKeyCase)
decode method has the functionality of an IF-THEN-ELSE statement. The value search is compared against expression. If expression is equal to search, then the result is returned. Otherwise, the default value is returned. If default is omitted, then the decode statement will return null (if no matches are found).
 Examples:
      decode(status, "1=Open, 0=Close", "-1=Unknown") would return "Open" if status has value 1.
      decode(sex, "m=Male, f=Female") would return "Male" if sex has value "m".
      decode(state, "CA=California, VA=Virginia", "Please select a state") would 
              return "California" if state has value "CA".
 

decode() can be combined with other methods too.

 Examples:
      decode((date1 - date2) - Math.abs(date1 - date2), "0=date2", date1) would 
              return date2 if date1 > date2. Otherwise, the decode function returns date1.
      
      The following has the same effect:
      decode(sign(date1-date2), 1, date2, date1)
 

Parameters:
expression - the value to compare.
searchResults - a map of search and result pair.
defaultValue - default value if a search returns no match.
ignoreKeyCase - true if cases of keys in searchResults are ignored.
Returns:
result of decode

nvl

public static java.lang.Object nvl(java.lang.Object value,
                                   java.lang.Object substituteWhenNull)
nvl method lets you substitute a value when a null value is encountered.

Parameters:
value - the value to test
substituteWhenNull - substitute value when value is null
Returns:
substitute when value is null

nvl

public static java.lang.String nvl(java.lang.String value,
                                   java.lang.String substituteWhenNull)
nvl method lets you substitute a value when a null value is encountered.

Parameters:
value - the value to test
substituteWhenNull - substitute value when value is null
Returns:
substitute when value is null

nvl

public static java.lang.Object nvl(java.lang.Object value,
                                   java.lang.Object substituteWhenNotNull,
                                   java.lang.Object substituteWhenNull)
nvl method lets you substitute a value when a null value is encountered as well as when a non-null value is encountered.

Parameters:
value - the value to test
substituteWhenNotNull - substitute value when value is not null
substituteWhenNull - substitute value when value is null
Returns:
substitute when value is null

nvl

public static java.lang.String nvl(java.lang.String value,
                                   java.lang.String substituteWhenNotNull,
                                   java.lang.String substituteWhenNull)
nvl method lets you substitute a value when a null value is encountered as well as when a non-null value is encountered.

Parameters:
value - the value to test
substituteWhenNotNull - substitute value when value is not null
substituteWhenNull - substitute value when value is null
Returns:
substitute when value is null

ifNull

public static java.lang.Object ifNull(java.lang.Object value,
                                      java.lang.Object substituteWhenNull)
ifNull method lets you substitute a value when a null value is encountered. This method is the same as the nvl method.

Parameters:
value - the value to test
substituteWhenNull - substitute value when value is null
Returns:
substitute when value is null

ifNull

public static java.lang.String ifNull(java.lang.String value,
                                      java.lang.String substituteWhenNull)
ifNull method lets you substitute a value when a null value is encountered. This method is the same as the nvl method.

Parameters:
value - the value to test
substituteWhenNull - substitute value when value is null
Returns:
substitute when value is null

ifNull

public static java.lang.Object ifNull(java.lang.Object value,
                                      java.lang.Object substituteWhenNotNull,
                                      java.lang.Object substituteWhenNull)
ifNull method lets you substitute a value when a null value is encountered as well as when a non-null value is encountered. This method is the same as the nvl method.

Parameters:
value - the value to test
substituteWhenNotNull - substitute value when value is not null
substituteWhenNull - substitute value when value is null
Returns:
substitute when value is null

ifNull

public static java.lang.String ifNull(java.lang.String value,
                                      java.lang.String substituteWhenNotNull,
                                      java.lang.String substituteWhenNull)
ifNull method lets you substitute a value when a null value is encountered as well as when a non-null value is encountered. This method is the same as the nvl method.

Parameters:
value - the value to test
substituteWhenNotNull - substitute value when value is not null
substituteWhenNull - substitute value when value is null
Returns:
substitute when value is null

ifTrue

public static java.lang.Object ifTrue(boolean state,
                                      java.lang.Object valueForTrue,
                                      java.lang.Object valueForFalse)
ifTrue method lets you choose a value when a true value is encountered as well as when a false value is encountered.

Parameters:
state - the state to test
valueForTrue - value when state is true
valueForFalse - value when state is false
Returns:
valueForTrue if state is true, otherwise valueForFalse.

ifEmpty

public static java.lang.Object ifEmpty(java.lang.Object value,
                                       java.lang.Object substituteWhenEmpty)
ifEmpty method lets you substitute a value when an empty value is encountered. An empty object is either null or an empty string.

Parameters:
value - the value to test
substituteWhenEmpty - substitute value when value is empty
Returns:
substitute when value is empty

ifEmpty

public static java.lang.Object ifEmpty(java.lang.Object value,
                                       java.lang.Object substituteWhenNotEmpty,
                                       java.lang.Object substituteWhenEmpty)
ifEmpty method lets you substitute a value when an empty value is encountered as well as when a non-null value is encountered. An empty object is either null or an empty string.

Parameters:
value - the value to test
substituteWhenNotEmpty - substitute value when value is not empty
substituteWhenEmpty - substitute value when value is empty
Returns:
substitute when value is empty

isEmpty

public static boolean isEmpty(java.lang.Object data)
Checks if a data object is empty. An empty object is either null or an empty string.

Parameters:
data - the data to check
Returns:
true if the data object is not empty

isInArray

public static boolean isInArray(java.lang.Object item,
                                java.lang.Object[] items)
Checks if an object exists in an array.

Parameters:
item - the object to check
items - an array of objects
Returns:
true if the array contains the object.

isInArray

public static boolean isInArray(java.lang.Object item,
                                java.lang.Object[] items,
                                boolean ignoreCase)
Checks if an object exists in an array.

Parameters:
item - the object to check
items - an array of objects
ignoreCase - indicates whether to ignore the string case or not when checking
Returns:
true if the array contains the object.

getShortClassName

public static java.lang.String getShortClassName(java.lang.Class<?> c)
returns short version of class name. The short version of a class name does not have its package name included in the class name.

Returns:
String

getShortClassNameInLowerCase

public static java.lang.String getShortClassNameInLowerCase(java.lang.Class<?> c)
returns short version of class name. The short version of a class name does not have its package name included in the class name.

Returns:
String

getFullClassName

public static java.lang.String getFullClassName(java.lang.Class<?> c)
returns the full class name

Returns:
String

getCurrencyDisplay

public static java.lang.String getCurrencyDisplay(java.lang.Object amount)

getCurrencyDisplay

public static java.lang.String getCurrencyDisplay(double amount)

getSafeDate

public static java.util.Date getSafeDate(java.util.Date date)
helper method used to safely acquire a Date

Parameters:
date - the original date object
Returns:
a safe date

getSafeDate

public static java.util.Date getSafeDate(java.lang.Object date)
helper method used to safely acquire a Date

Parameters:
date - the original date object
Returns:
a safe date

getSafeFloatValue

public static float getSafeFloatValue(java.lang.Object input)
helper method used to safely acquire a float value

Parameters:
input - input data
Returns:
a float value converted from the input

getSafeDoubleValue

public static double getSafeDoubleValue(java.lang.Object input)
helper method used to safely acquire a double value

Parameters:
input - input data
Returns:
a double value converted from the input

getSafeIntValue

public static int getSafeIntValue(java.lang.Object input)
helper method used to safely acquire a int value

Parameters:
input - input data
Returns:
an int value converted from the input

getSafeLongValue

public static long getSafeLongValue(java.lang.Object input)
helper method used to safely acquire a long value

Parameters:
input - input data
Returns:
a long value converted from the input

getSafeFloat

public static java.lang.Float getSafeFloat(java.math.BigDecimal input)
helper method used to safely acquire a Float object

Parameters:
input - an input BigDecimal instance
Returns:
a Float object converted from the input

getSafeDouble

public static java.lang.Double getSafeDouble(java.math.BigDecimal input)
helper method used to safely acquire a Double object

Parameters:
input - an input BigDecimal instance
Returns:
a Double object converted from the input

getSafeInteger

public static java.lang.Integer getSafeInteger(java.math.BigDecimal input)
helper method used to safely acquire a Integer object

Parameters:
input - an input BigDecimal instance
Returns:
an Integer object converted from the input

getSafeLong

public static java.lang.Long getSafeLong(java.math.BigDecimal input)
helper method used to safely acquire a Long object

Parameters:
input - an input BigDecimal instance
Returns:
a Long object converted from the input

getSafeFloat

public static java.lang.Float getSafeFloat(java.lang.Object input)
helper method used to safely acquire a Float object

Parameters:
input - input data
Returns:
a Float object converted from the input

getSafeDouble

public static java.lang.Double getSafeDouble(java.lang.Object input)
helper method used to safely acquire a Double object

Parameters:
input - input data
Returns:
a Double object converted from the input

getSafeInteger

public static java.lang.Integer getSafeInteger(java.lang.Object input)
helper method used to safely acquire a Integer object

Parameters:
input - input data
Returns:
an Integer object converted from the input

getSafeLong

public static java.lang.Long getSafeLong(java.lang.Object input)
helper method used to safely acquire a Long object

Parameters:
input - input data
Returns:
a Long object converted from the input

getSafeCharacter

public static java.lang.Character getSafeCharacter(java.lang.String sValue)
helper method used to safely acquire a Character from the first char of the input string.

Parameters:
sValue - an input string
Returns:
a Character object

getSafeCharacter

public static java.lang.Character getSafeCharacter(java.lang.Object sValue)
helper method used to safely acquire a Character from the first char of the input object.

Parameters:
sValue - an input object
Returns:
a Character object

getSafeString

public static java.lang.String getSafeString(java.lang.Object input)
helper method used to safely acquire a String

Parameters:
input - the input string
Returns:
a string of the input

getTomorrowCalendar

public static java.util.Calendar getTomorrowCalendar()

getDate

public static java.util.Date getDate(java.lang.String dateString,
                                     java.lang.String format,
                                     java.util.TimeZone tz)
                              throws java.lang.Exception
Throws:
java.lang.Exception

getDate

public static java.util.Date getDate(java.lang.String dateString,
                                     java.lang.String format)
                              throws java.lang.Exception
Throws:
java.lang.Exception

getCalendar

public static java.util.Calendar getCalendar(java.lang.String dateString,
                                             java.lang.String format,
                                             java.util.TimeZone tz)
                                      throws java.lang.Exception
Throws:
java.lang.Exception

getCalendar

public static java.util.Calendar getCalendar(java.lang.String dateString,
                                             java.lang.String format)
                                      throws java.lang.Exception
Throws:
java.lang.Exception

getTimestamp

public static java.sql.Timestamp getTimestamp(java.lang.String dateString,
                                              java.lang.String format)
                                       throws java.lang.Exception
Throws:
java.lang.Exception

getCurrentCalendarInGMT

public static java.util.Calendar getCurrentCalendarInGMT()
                                                  throws java.lang.Exception
Throws:
java.lang.Exception

getDateString

public static java.lang.String getDateString(java.util.Date date,
                                             java.lang.String format)
                                      throws java.lang.Exception
Throws:
java.lang.Exception

parseDateByFormat

public static java.util.Date parseDateByFormat(java.lang.String dateString,
                                               java.lang.String format)

getBooleanValue

public static boolean getBooleanValue(java.util.Map<java.lang.String,?> inputs,
                                      java.lang.String key,
                                      boolean defaultValue)

getBooleanValueForKey

public static boolean getBooleanValueForKey(java.util.Map<java.lang.String,?> inputs,
                                            java.lang.String key)

getIntValue

public static int getIntValue(java.util.Map<java.lang.String,?> inputs,
                              java.lang.String key,
                              int defaultValue)

getIntValueForKey

public static int getIntValueForKey(java.util.Map<java.lang.String,?> inputs,
                                    java.lang.String key)

getLongValue

public static long getLongValue(java.util.Map<java.lang.String,?> inputs,
                                java.lang.String key,
                                long defaultValue)

getLongValueForKey

public static long getLongValueForKey(java.util.Map<java.lang.String,?> inputs,
                                      java.lang.String key)

getStringValue

public static java.lang.String getStringValue(java.util.Map<java.lang.String,?> inputs,
                                              java.lang.String key,
                                              java.lang.String defaultValue)

getStringValueForKey

public static java.lang.String getStringValueForKey(java.util.Map<java.lang.String,?> inputs,
                                                    java.lang.String key)

md5

public static java.lang.String md5(java.lang.String input)
Returns a MD5 digest string of the input string.

Parameters:
input - the input string
Returns:
the MD5 digest string

cloneArray

public static int[] cloneArray(int[] array)
Creates a copy of string array.

Parameters:
array - an int array
Returns:
a cloned int array

cloneArray

public static java.lang.String[] cloneArray(java.lang.String[] array)
Creates a copy of string array.

Parameters:
array - a String array
Returns:
a cloned String array