Package snap.util
Class Convert
java.lang.Object
snap.util.Convert
This class holds utilities to convert values.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Boolean
booleanValue
(Object anObj) Returns the Boolean for a given object (assumed to be Number or String).static boolean
Returns a boolean value for the given object.static float[]
doubleArrayToFloat
(double[] theDoubles) Returns a float array for given doubles.static String
doubleArrayToString
(double[] theValues) Return string for double array.static double
doubleValue
(Object anObj) Returns the double value for a given object (assumed to be a string or number).static double[]
floatArrayToDouble
(float[] theFloats) Returns a double array for given floats.static float
floatValue
(Object anObj) Returns the float value for a given object (assumed to be a string or number).static BigDecimal
getBigDecimal
(Object anObj) Returns the BigDecimal for a given object (assumed to be a string or number).static Date
Returns a date for given object of arbitrary type.static Double
Returns a Double for a given object.static Float
Returns a Float for a given object.static Integer
getInteger
(Object anObj) Returns the Integer for a given object.static int
Returns the int value for a given object (assumed to be a string or number).static long
Returns the int value for a given object (assumed to be a string or number).static Number
numberValue
(Object anObj) Returns the Number for a given object (assumed to be Number or String).static double[]
stringToDoubleArray
(String aStr) Returns an array of double values for given comma separated string.static String[]
stringToStringArray
(String aStr) Returns an array of String values for given comma separated string.static String
stringValue
(Object anObj) Returns a String for a given arbitrary object.
-
Constructor Details
-
Convert
public Convert()
-
-
Method Details
-
boolValue
Returns a boolean value for the given object. -
intValue
Returns the int value for a given object (assumed to be a string or number). -
longValue
Returns the int value for a given object (assumed to be a string or number). -
floatValue
Returns the float value for a given object (assumed to be a string or number). -
doubleValue
Returns the double value for a given object (assumed to be a string or number). -
stringValue
Returns a String for a given arbitrary object. -
booleanValue
Returns the Boolean for a given object (assumed to be Number or String). -
numberValue
Returns the Number for a given object (assumed to be Number or String). -
getInteger
Returns the Integer for a given object. -
getFloat
Returns a Float for a given object. -
getDouble
Returns a Double for a given object. -
getBigDecimal
Returns the BigDecimal for a given object (assumed to be a string or number). -
floatArrayToDouble
public static double[] floatArrayToDouble(float[] theFloats) Returns a double array for given floats. -
doubleArrayToFloat
public static float[] doubleArrayToFloat(double[] theDoubles) Returns a float array for given doubles. -
doubleArrayToString
Return string for double array. -
stringToDoubleArray
Returns an array of double values for given comma separated string. -
stringToStringArray
Returns an array of String values for given comma separated string. -
getDate
Returns a date for given object of arbitrary type.
-