Value Class

A general purpose wrapper for Objects. The value can be converted into a number of Java primitives including strings, integers, doubles, booleans, etc.

Constructors

Value( Object value )

Public Methods

toObject( ) returns Object
Returns the object used to instantiate this class.
toInteger( ) returns Integer
Returns the value as an integer. Returns a null if there was a problem converting the value to an integer or if the value is null.
toShort( ) returns Short
Returns the value as a short. Returns a null if there was a problem converting the value to a short or if the value is null.
toDouble( ) returns Double
Returns the value as a double. Returns a null if there was a problem converting the value to a double or if the value is null.
toLong( ) returns Long
Returns the value as a long. Returns a null if there was a problem converting the value to a long or if the value is null.
toBigDecimal( ) returns java.math.BigDecimal
Returns the value as a BigDecimal. Returns a null if there was a problem converting the value to a BigDecimal or if the value is null.
toFloat( ) returns Float
Returns the value as a float. Returns a null if there was a problem converting the value to a float or if the value is null.
toDate( ) returns javaxt.utils.Date
Returns the value as a Date. Returns a null if there was a problem converting the value to a Date or if the value is null.
toByteArray( ) returns byte[]
Returns the value as a byte array. Returns a null if the value is null or if there was a problem converting the value to a byte array. Note that if the underlying object is a String, and if the String appears to represent a Base64 encoded byte array, then an attempt is made to decode the Base64 String. Otherwise, this method will simply write the value to a ByteArrayOutputStream and return the raw bytes.
toBoolean( ) returns Boolean
Returns the value as a Boolean. Returns null if the value is null or cannot be converted to a Boolean.
isNumeric( ) returns boolean
Returns true if the value is numeric.
isArray( ) returns boolean
Returns true is the value is an array.
isNull( ) returns boolean
Returns true if the value is null.
toString( ) returns String
Returns a string representation of the object by calling the object's native toString() method. Returns a null if the object itself is null.
equals( Object obj ) returns boolean
Used to compare values. Accepts any object.