public class IntegerUtil
extends java.lang.Object
Constructor and Description |
---|
IntegerUtil() |
Modifier and Type | Method and Description |
---|---|
static java.lang.Integer |
nvl(java.lang.Integer checkValue,
java.lang.Integer valueIfNull)
This method converts null values
|
static java.lang.Integer |
random()
This method returns an unbounded random integer
|
static java.lang.Integer |
random(java.lang.Integer max)
This method returns a random integer between 0 and the given maximum inclusive
|
static java.lang.Integer |
random(java.lang.Integer min,
java.lang.Integer max)
This method returns a random integer within the specified range inclusive
|
static void |
registerTypeConverter(TypeConverter<?,java.lang.Integer> converter)
This method registers with this static utility an instance of a Integer TypeConverter to convert an instance of the convertible class
into a Integer value
|
static java.lang.Boolean |
toBoolean(java.lang.Integer v)
This method converts the given Integer into a Boolean value
|
static java.util.Date |
toDate(java.lang.Integer v)
This method converts the given Integer into a Date value
|
static java.lang.Double |
toDouble(java.lang.Integer v)
This method converts the given Integer into a Double value
|
static java.lang.Float |
toFloat(java.lang.Integer v)
This method converts the given Integer into a Float value
|
static java.lang.Integer |
toInteger(java.lang.Object v)
This method converts the given object into a Integer value
Static utility methods convert Strings, Integers, Longs, Floats, Doubles, Dates and Booleans into Integer values
If the given object is not one of the above types then a type converter must have been registered with this static utility
in order for the given object to be converted into a Integer value
If no type converter has been registered for the class of the given object then a null is returned
|
static java.lang.Long |
toLong(java.lang.Integer v)
This method converts the given Integer into a Long value
|
static java.lang.String |
toString(java.lang.Integer v)
This method converts the given Integer into a String value
|
public static void registerTypeConverter(TypeConverter<?,java.lang.Integer> converter)
converter
- The Integer TypeConverter instancepublic static java.lang.Integer toInteger(java.lang.Object v)
v
- The object to convert into a Integer valuepublic static java.lang.Long toLong(java.lang.Integer v)
v
- The Integer to convertpublic static java.lang.Float toFloat(java.lang.Integer v)
v
- The Integer to convertpublic static java.lang.Double toDouble(java.lang.Integer v)
v
- The Integer to convertpublic static java.lang.Boolean toBoolean(java.lang.Integer v)
v
- The Integer to convertpublic static java.util.Date toDate(java.lang.Integer v)
v
- The Integer to convertpublic static java.lang.String toString(java.lang.Integer v)
v
- The Integer to convertpublic static java.lang.Integer random()
public static java.lang.Integer random(java.lang.Integer max)
max
- The maximum random numberpublic static java.lang.Integer random(java.lang.Integer min, java.lang.Integer max)
min
- The minimum value for the random integermax
- The maximum value for the random integerpublic static java.lang.Integer nvl(java.lang.Integer checkValue, java.lang.Integer valueIfNull)
checkValue
- The value to check for nullvalueIfNull
- The value to return if the value to check is null