public class Cast
extends java.lang.Object
| Constructor and Description |
|---|
Cast() |
| Modifier and Type | Method and Description |
|---|---|
private static JSONException |
errorToBigDecimal(java.lang.Object value)
Creates a JSONException for BigDecimal conversion errors.
|
private static JSONException |
errorToBigInteger(java.lang.Object value)
Creates a JSONException for BigInteger conversion errors.
|
private static JSONException |
errorToBoolean(java.lang.Object value)
Creates a JSONException for boolean conversion errors.
|
private static JSONException |
errorToByte(java.lang.Object value)
Creates a JSONException for byte conversion errors.
|
private static JSONException |
errorToChar(java.lang.Object value)
Creates a JSONException for char conversion errors.
|
private static JSONException |
errorToDouble(java.lang.Object value)
Creates a JSONException for double conversion errors.
|
private static JSONException |
errorToFloat(java.lang.Object value)
Creates a JSONException for float conversion errors.
|
private static JSONException |
errorToInt(java.lang.Object value)
Creates a JSONException for int conversion errors.
|
private static JSONException |
errorToLong(java.lang.Object value)
Creates a JSONException for long conversion errors.
|
private static JSONException |
errorToNumber(java.lang.Object value)
Creates a JSONException for Number conversion errors.
|
private static JSONException |
errorToShort(java.lang.Object value)
Creates a JSONException for short conversion errors.
|
static java.math.BigDecimal |
toBigDecimal(boolean value)
Converts a boolean to BigDecimal.
|
static java.math.BigDecimal |
toBigDecimal(byte value)
Converts a byte to BigDecimal.
|
static java.math.BigDecimal |
toBigDecimal(char value)
Converts a char to BigDecimal.
|
static java.math.BigDecimal |
toBigDecimal(double value)
Converts a double to BigDecimal.
|
static java.math.BigDecimal |
toBigDecimal(float value)
Converts a float to BigDecimal.
|
static java.math.BigDecimal |
toBigDecimal(int value)
Converts an int to BigDecimal.
|
static java.math.BigDecimal |
toBigDecimal(long value)
Converts a long to BigDecimal.
|
static java.math.BigDecimal |
toBigDecimal(java.lang.Object value)
Converts an Object to BigDecimal.
|
static java.math.BigDecimal |
toBigDecimal(short value)
Converts a short to BigDecimal.
|
static java.math.BigDecimal |
toBigDecimal(java.lang.String value)
Converts a String to BigDecimal.
|
private static java.math.BigDecimal |
toBigDecimalEx(java.lang.Object value)
Helper method that contains the more complex conversion logic.
|
static java.math.BigInteger |
toBigInteger(boolean value)
Converts a boolean to BigInteger.
|
static java.math.BigInteger |
toBigInteger(byte value)
Converts a byte to BigInteger.
|
static java.math.BigInteger |
toBigInteger(char value)
Converts a char to BigInteger.
|
static java.math.BigInteger |
toBigInteger(double value)
Converts a double to BigInteger.
|
static java.math.BigInteger |
toBigInteger(float value)
Converts a float to BigInteger.
|
static java.math.BigInteger |
toBigInteger(int value)
Converts an int to BigInteger.
|
static java.math.BigInteger |
toBigInteger(long value)
Converts a long to BigInteger.
|
static java.math.BigInteger |
toBigInteger(java.lang.Object value)
Converts an Object to BigInteger.
|
static java.math.BigInteger |
toBigInteger(short value)
Converts a short to BigInteger.
|
static java.math.BigInteger |
toBigInteger(java.lang.String value)
Converts a String to BigInteger.
|
private static java.math.BigInteger |
toBigIntegerEx(java.lang.Object value)
Helper method that contains the more complex conversion logic.
|
static java.lang.Boolean |
toBoolean(java.lang.Object value)
Converts an Object to Boolean.
|
private static boolean |
toBooleanEx(java.lang.Object value)
Helper method for converting non-Boolean objects to boolean.
|
static boolean |
toBooleanValue(java.math.BigDecimal value)
Converts a BigDecimal to boolean.
|
static boolean |
toBooleanValue(java.math.BigInteger value)
Converts a BigInteger to boolean.
|
static boolean |
toBooleanValue(byte value)
Converts a byte to boolean.
|
static boolean |
toBooleanValue(char value)
Converts a char to boolean.
|
static boolean |
toBooleanValue(double value)
Converts a double to boolean.
|
static boolean |
toBooleanValue(float value)
Converts a float to boolean.
|
static boolean |
toBooleanValue(int value)
Converts an int to boolean.
|
static boolean |
toBooleanValue(long value)
Converts a long to boolean.
|
static boolean |
toBooleanValue(java.lang.Object value)
Converts an Object to boolean.
|
static boolean |
toBooleanValue(short value)
Converts a short to boolean.
|
static boolean |
toBooleanValue(java.lang.String value)
Converts a String to boolean.
|
static java.lang.Byte |
toByte(java.lang.Object value) |
private static byte |
toByteEx(java.lang.Object value)
Helper method for converting non-Number objects to byte.
|
static byte |
toByteValue(java.math.BigDecimal value)
Converts a BigDecimal to byte.
|
static byte |
toByteValue(java.math.BigInteger value)
Converts a BigInteger to byte.
|
static byte |
toByteValue(boolean value)
Converts a boolean to byte.
|
static byte |
toByteValue(char value)
Converts a char to byte.
|
static byte |
toByteValue(double value)
Converts a double to byte.
|
static byte |
toByteValue(float value)
Converts a float to byte.
|
static byte |
toByteValue(int value)
Converts an int to byte.
|
static byte |
toByteValue(long value)
Converts a long to byte.
|
static byte |
toByteValue(java.lang.Object value)
Converts an Object to byte.
|
static byte |
toByteValue(short value)
Converts a short to byte.
|
static byte |
toByteValue(java.lang.String value)
Converts a String to byte.
|
static java.lang.Character |
toCharacter(java.lang.Object value)
Converts an Object to Character.
|
private static char |
toCharEx(java.lang.Object value)
Helper method for converting non-Character objects to char.
|
static char |
toCharValue(java.math.BigDecimal value)
Converts a BigDecimal to char.
|
static char |
toCharValue(java.math.BigInteger value)
Converts a BigInteger to char.
|
static char |
toCharValue(boolean value)
Converts a boolean to char.
|
static char |
toCharValue(double value)
Converts a double to char.
|
static char |
toCharValue(float value)
Converts a float to char.
|
static char |
toCharValue(int value)
Converts an int to char.
|
static char |
toCharValue(long value)
Converts a long to char.
|
static char |
toCharValue(java.lang.Object value)
Converts an Object to char.
|
static char |
toCharValue(short value)
Converts a short to char.
|
static char |
toCharValue(java.lang.String value)
Converts a String to char.
|
static java.lang.Double |
toDouble(java.lang.Object value)
Converts an Object to Double.
|
private static double |
toDoubleEx(java.lang.Object value)
Helper method for converting non-Number objects to double.
|
static double |
toDoubleValue(java.math.BigDecimal value)
Converts a BigDecimal to double.
|
static double |
toDoubleValue(java.math.BigInteger value)
Converts a BigInteger to double.
|
static double |
toDoubleValue(boolean value)
Converts a boolean to double.
|
static double |
toDoubleValue(char value)
Converts a char to double.
|
static double |
toDoubleValue(int value)
Converts an int to double.
|
static double |
toDoubleValue(long value)
Converts a long to double.
|
static double |
toDoubleValue(java.lang.Object value)
Converts an Object to double.
|
static double |
toDoubleValue(java.lang.String value)
Converts a String to double.
|
static java.lang.Float |
toFloat(java.lang.Object value)
Converts an Object to Float.
|
private static float |
toFloatEx(java.lang.Object value)
Helper method for converting non-Number objects to float.
|
static float |
toFloatValue(java.math.BigDecimal value)
Converts a BigDecimal to float.
|
static float |
toFloatValue(java.math.BigInteger value)
Converts a BigInteger to float.
|
static float |
toFloatValue(boolean value)
Converts a boolean to float.
|
static float |
toFloatValue(char value)
Converts a char to float.
|
static float |
toFloatValue(double value)
Converts a double to float.
|
static float |
toFloatValue(int value)
Converts an int to float.
|
static float |
toFloatValue(long value)
Converts a long to float.
|
static float |
toFloatValue(java.lang.Object value)
Converts an Object to float.
|
static float |
toFloatValue(short value)
Converts a short to float.
|
static float |
toFloatValue(java.lang.String value)
Converts a String to float.
|
static java.lang.Integer |
toInteger(java.lang.Object value)
Converts an Object to Integer.
|
private static int |
toIntEx(java.lang.Object value)
Helper method for converting non-Number objects to int.
|
static int |
toIntValue(java.math.BigDecimal value)
Converts a BigDecimal to int.
|
static int |
toIntValue(java.math.BigInteger value)
Converts a BigInteger to int.
|
static int |
toIntValue(char value)
Converts a char to int.
|
static int |
toIntValue(double value)
Converts a double to int.
|
static int |
toIntValue(float value)
Converts a float to int.
|
static int |
toIntValue(long value)
Converts a long to int.
|
static int |
toIntValue(java.lang.Object value)
Converts an Object to int.
|
static int |
toIntValue(java.lang.String value)
Converts a String to int.
|
static java.lang.Long |
toLong(java.lang.Object value)
Converts an Object to Long.
|
private static long |
toLongEx(java.lang.Object value)
Helper method for converting non-Number objects to long.
|
static long |
toLongValue(java.math.BigDecimal value)
Converts a BigDecimal to long.
|
static long |
toLongValue(java.math.BigInteger value)
Converts a BigInteger to long.
|
static long |
toLongValue(boolean value)
Converts a boolean to long.
|
static long |
toLongValue(char value)
Converts a char to long.
|
static long |
toLongValue(double value)
Converts a double to long.
|
static long |
toLongValue(float value)
Converts a float to long.
|
static long |
toLongValue(int value)
Converts an int to long.
|
static long |
toLongValue(java.lang.Object value)
Converts an Object to long.
|
static long |
toLongValue(short value)
Converts a short to long.
|
static long |
toLongValue(java.lang.String value)
Converts a String to long.
|
static java.lang.Number |
toNumber(java.math.BigDecimal value)
Converts a BigDecimal to Number.
|
static java.lang.Number |
toNumber(java.math.BigInteger value)
Converts a BigInteger to Number.
|
static java.lang.Number |
toNumber(boolean value)
Converts a boolean to Number.
|
static java.lang.Number |
toNumber(byte value)
Converts a byte to Number.
|
static java.lang.Number |
toNumber(char value)
Converts a char to Number.
|
static java.lang.Number |
toNumber(double value)
Converts a double to Number.
|
static java.lang.Number |
toNumber(float value)
Converts a float to Number.
|
static java.lang.Number |
toNumber(int value)
Converts an int to Number.
|
static java.lang.Number |
toNumber(long value)
Converts a long to Number.
|
static java.lang.Number |
toNumber(java.lang.Object value)
Converts an Object to Number.
|
static java.lang.Number |
toNumber(short value)
Converts a short to Number.
|
static java.lang.Number |
toNumber(java.lang.String value)
Converts a String to Number.
|
private static java.lang.Number |
toNumberEx(java.lang.Object value)
Helper method for converting non-Number objects to Number.
|
static java.lang.Short |
toShort(java.lang.Object value)
Converts an Object to Short.
|
private static short |
toShortEx(java.lang.Object value)
Helper method for converting non-Number objects to short.
|
static short |
toShortValue(java.math.BigDecimal value)
Converts a BigDecimal to short.
|
static short |
toShortValue(java.math.BigInteger value)
Converts a BigInteger to short.
|
static short |
toShortValue(boolean value)
Converts a boolean to short.
|
static short |
toShortValue(char value)
Converts a char to short.
|
static short |
toShortValue(double value)
Converts a double to short.
|
static short |
toShortValue(float value)
Converts a float to short.
|
static short |
toShortValue(int value)
Converts an int to short.
|
static short |
toShortValue(long value)
Converts a long to short.
|
static short |
toShortValue(java.lang.Object value)
Converts an Object to short.
|
static short |
toShortValue(java.lang.String value)
Converts a String to short.
|
static java.lang.String |
toString(java.math.BigDecimal value)
Converts a BigDecimal to String.
|
static java.lang.String |
toString(java.math.BigInteger value)
Converts a BigInteger to String.
|
static java.lang.String |
toString(boolean value)
Converts a boolean to String.
|
static java.lang.String |
toString(byte value)
Converts a byte to String.
|
static java.lang.String |
toString(char value)
Converts a char to String.
|
static java.lang.String |
toString(double value)
Converts a double to String.
|
static java.lang.String |
toString(float value)
Converts a float to String.
|
static java.lang.String |
toString(int value)
Converts an int to String.
|
static java.lang.String |
toString(long value)
Converts a long to String.
|
static java.lang.String |
toString(java.lang.Object value)
Converts an Object to String.
|
static java.lang.String |
toString(short value)
Converts a short to String.
|
public static byte toByteValue(java.lang.Object value)
value - the Object to convertpublic static java.lang.Byte toByte(java.lang.Object value)
public static java.lang.Short toShort(java.lang.Object value)
value - the Object to convertpublic static java.lang.Integer toInteger(java.lang.Object value)
value - the Object to convertpublic static java.lang.Long toLong(java.lang.Object value)
value - the Object to convertpublic static java.lang.Float toFloat(java.lang.Object value)
value - the Object to convertpublic static java.lang.Double toDouble(java.lang.Object value)
value - the Object to convertpublic static java.lang.Character toCharacter(java.lang.Object value)
value - the Object to convertpublic static java.lang.Boolean toBoolean(java.lang.Object value)
value - the Object to convertprivate static byte toByteEx(java.lang.Object value)
value - the Object to convertprivate static JSONException errorToByte(java.lang.Object value)
value - the value that caused the errorpublic static byte toByteValue(short value)
value - the short to convertpublic static byte toByteValue(int value)
value - the int to convertpublic static byte toByteValue(long value)
value - the long to convertpublic static byte toByteValue(char value)
value - the char to convertpublic static byte toByteValue(boolean value)
value - the boolean to convertpublic static byte toByteValue(float value)
value - the float to convertpublic static byte toByteValue(double value)
value - the double to convertpublic static byte toByteValue(java.lang.String value)
value - the String to convertpublic static byte toByteValue(java.math.BigInteger value)
value - the BigInteger to convertpublic static byte toByteValue(java.math.BigDecimal value)
value - the BigDecimal to convertpublic static char toCharValue(java.lang.Object value)
value - the Object to convertprivate static char toCharEx(java.lang.Object value)
value - the Object to convertprivate static JSONException errorToChar(java.lang.Object value)
value - the value that caused the errorpublic static char toCharValue(boolean value)
value - the boolean to convertpublic static char toCharValue(short value)
value - the short to convertpublic static char toCharValue(int value)
value - the int to convertpublic static char toCharValue(long value)
value - the long to convertpublic static char toCharValue(float value)
value - the float to convertpublic static char toCharValue(double value)
value - the double to convertpublic static char toCharValue(java.lang.String value)
value - the String to convertpublic static char toCharValue(java.math.BigInteger value)
value - the BigInteger to convertpublic static char toCharValue(java.math.BigDecimal value)
value - the BigDecimal to convertpublic static short toShortValue(java.lang.Object value)
value - the Object to convertprivate static short toShortEx(java.lang.Object value)
value - the Object to convertprivate static JSONException errorToShort(java.lang.Object value)
value - the value that caused the errorpublic static short toShortValue(char value)
value - the char to convertpublic static short toShortValue(boolean value)
value - the boolean to convertpublic static short toShortValue(int value)
value - the int to convertpublic static short toShortValue(long value)
value - the long to convertpublic static short toShortValue(float value)
value - the float to convertpublic static short toShortValue(double value)
value - the double to convertpublic static short toShortValue(java.lang.String value)
value - the String to convertpublic static short toShortValue(java.math.BigInteger value)
value - the BigInteger to convertpublic static short toShortValue(java.math.BigDecimal value)
value - the BigDecimal to convertpublic static int toIntValue(java.lang.Object value)
value - the Object to convertprivate static int toIntEx(java.lang.Object value)
value - the Object to convertprivate static JSONException errorToInt(java.lang.Object value)
value - the value that caused the errorpublic static int toIntValue(char value)
value - the char to convertpublic static int toIntValue(long value)
value - the long to convertpublic static int toIntValue(float value)
value - the float to convertpublic static int toIntValue(double value)
value - the double to convertpublic static int toIntValue(java.lang.String value)
value - the String to convertpublic static int toIntValue(java.math.BigInteger value)
value - the BigInteger to convertpublic static int toIntValue(java.math.BigDecimal value)
value - the BigDecimal to convertpublic static long toLongValue(java.lang.Object value)
value - the Object to convertprivate static long toLongEx(java.lang.Object value)
value - the Object to convertprivate static JSONException errorToLong(java.lang.Object value)
value - the value that caused the errorpublic static long toLongValue(short value)
value - the short to convertpublic static long toLongValue(char value)
value - the char to convertpublic static long toLongValue(boolean value)
value - the boolean to convertpublic static long toLongValue(int value)
value - the int to convertpublic static long toLongValue(float value)
value - the float to convertpublic static long toLongValue(double value)
value - the double to convertpublic static long toLongValue(java.lang.String value)
value - the String to convertpublic static long toLongValue(java.math.BigInteger value)
value - the BigInteger to convertpublic static long toLongValue(java.math.BigDecimal value)
value - the BigDecimal to convertpublic static float toFloatValue(java.lang.Object value)
value - the Object to convertprivate static float toFloatEx(java.lang.Object value)
value - the Object to convertprivate static JSONException errorToFloat(java.lang.Object value)
value - the value that caused the errorpublic static float toFloatValue(short value)
value - the short to convertpublic static float toFloatValue(char value)
value - the char to convertpublic static float toFloatValue(int value)
value - the int to convertpublic static float toFloatValue(long value)
value - the long to convertpublic static float toFloatValue(double value)
value - the double to convertpublic static float toFloatValue(boolean value)
value - the boolean to convertpublic static float toFloatValue(java.lang.String value)
value - the String to convertpublic static float toFloatValue(java.math.BigInteger value)
value - the BigInteger to convertpublic static float toFloatValue(java.math.BigDecimal value)
value - the BigDecimal to convertpublic static double toDoubleValue(java.lang.Object value)
value - the Object to convertpublic static double toDoubleValue(int value)
value - the int to convertpublic static double toDoubleValue(long value)
value - the long to convertprivate static double toDoubleEx(java.lang.Object value)
value - the Object to convertprivate static JSONException errorToDouble(java.lang.Object value)
value - the value that caused the errorpublic static double toDoubleValue(boolean value)
value - the boolean to convertpublic static double toDoubleValue(char value)
value - the char to convertpublic static double toDoubleValue(java.lang.String value)
value - the String to convertpublic static double toDoubleValue(java.math.BigInteger value)
value - the BigInteger to convertpublic static double toDoubleValue(java.math.BigDecimal value)
value - the BigDecimal to convertpublic static boolean toBooleanValue(java.lang.Object value)
value - the Object to convertprivate static boolean toBooleanEx(java.lang.Object value)
value - the Object to convertprivate static JSONException errorToBoolean(java.lang.Object value)
value - the value that caused the errorpublic static boolean toBooleanValue(byte value)
value - the byte to convertpublic static boolean toBooleanValue(short value)
value - the short to convertpublic static boolean toBooleanValue(char value)
value - the char to convertpublic static boolean toBooleanValue(int value)
value - the int to convertpublic static boolean toBooleanValue(long value)
value - the long to convertpublic static boolean toBooleanValue(float value)
value - the float to convertpublic static boolean toBooleanValue(double value)
value - the double to convertpublic static boolean toBooleanValue(java.lang.String value)
value - the String to convertpublic static boolean toBooleanValue(java.math.BigInteger value)
value - the BigInteger to convertpublic static boolean toBooleanValue(java.math.BigDecimal value)
value - the BigDecimal to convertpublic static java.math.BigInteger toBigInteger(java.lang.Object value)
private static java.math.BigInteger toBigIntegerEx(java.lang.Object value)
private static JSONException errorToBigInteger(java.lang.Object value)
value - the value that caused the errorpublic static java.math.BigInteger toBigInteger(byte value)
value - the byte to convertpublic static java.math.BigInteger toBigInteger(short value)
value - the short to convertpublic static java.math.BigInteger toBigInteger(char value)
value - the char to convertpublic static java.math.BigInteger toBigInteger(int value)
value - the int to convertpublic static java.math.BigInteger toBigInteger(long value)
value - the long to convertpublic static java.math.BigInteger toBigInteger(float value)
value - the float to convertpublic static java.math.BigInteger toBigInteger(double value)
value - the double to convertpublic static java.math.BigInteger toBigInteger(boolean value)
value - the boolean to convertpublic static java.math.BigInteger toBigInteger(java.lang.String value)
value - the String to convertpublic static java.math.BigDecimal toBigDecimal(java.lang.Object value)
private static java.math.BigDecimal toBigDecimalEx(java.lang.Object value)
private static JSONException errorToBigDecimal(java.lang.Object value)
value - the value that caused the errorpublic static java.math.BigDecimal toBigDecimal(byte value)
value - the byte to convertpublic static java.math.BigDecimal toBigDecimal(short value)
value - the short to convertpublic static java.math.BigDecimal toBigDecimal(char value)
value - the char to convertpublic static java.math.BigDecimal toBigDecimal(int value)
value - the int to convertpublic static java.math.BigDecimal toBigDecimal(long value)
value - the long to convertpublic static java.math.BigDecimal toBigDecimal(float value)
value - the float to convertpublic static java.math.BigDecimal toBigDecimal(double value)
value - the double to convertpublic static java.math.BigDecimal toBigDecimal(boolean value)
value - the boolean to convertpublic static java.math.BigDecimal toBigDecimal(java.lang.String value)
value - the String to convertpublic static java.lang.String toString(java.lang.Object value)
value - the Object to convertpublic static java.lang.String toString(byte value)
value - the byte to convertpublic static java.lang.String toString(short value)
value - the short to convertpublic static java.lang.String toString(char value)
value - the char to convertpublic static java.lang.String toString(int value)
value - the int to convertpublic static java.lang.String toString(long value)
value - the long to convertpublic static java.lang.String toString(float value)
value - the float to convertpublic static java.lang.String toString(double value)
value - the double to convertpublic static java.lang.String toString(boolean value)
value - the boolean to convertpublic static java.lang.String toString(java.math.BigInteger value)
value - the BigInteger to convertpublic static java.lang.String toString(java.math.BigDecimal value)
value - the BigDecimal to convertpublic static java.lang.Number toNumber(java.lang.Object value)
value - the Object to convertprivate static java.lang.Number toNumberEx(java.lang.Object value)
value - the Object to convertprivate static JSONException errorToNumber(java.lang.Object value)
value - the value that caused the errorpublic static java.lang.Number toNumber(byte value)
value - the byte to convertpublic static java.lang.Number toNumber(short value)
value - the short to convertpublic static java.lang.Number toNumber(char value)
value - the char to convertpublic static java.lang.Number toNumber(int value)
value - the int to convertpublic static java.lang.Number toNumber(long value)
value - the long to convertpublic static java.lang.Number toNumber(float value)
value - the float to convertpublic static java.lang.Number toNumber(double value)
value - the double to convertpublic static java.lang.Number toNumber(boolean value)
value - the boolean to convertpublic static java.lang.Number toNumber(java.lang.String value)
value - the String to convertpublic static java.lang.Number toNumber(java.math.BigInteger value)
value - the BigInteger to convertpublic static java.lang.Number toNumber(java.math.BigDecimal value)
value - the BigDecimal to convert