public final class JavaTypeUtils extends Object
| Constructor and Description |
|---|
JavaTypeUtils() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
isBoolean(Object value)
Check whether this primitive contains a boolean value.
|
static boolean |
isNumber(Object value)
Check whether this primitive contains a Number.
|
static boolean |
isPrimitiveOrString(Object value)
Check whether this primitive contains a Primitive or String value.
|
static boolean |
isString(Object value)
Check whether this primitive contains a String value.
|
static BigDecimal |
toBigDecimal(Object value)
convert this value as a
BigDecimal. |
static BigInteger |
toBigInteger(Object value)
convert this value as a
BigInteger. |
static boolean |
toBoolean(Object value)
convert this value as a primitive boolean value.
|
static Boolean |
toBooleanWrapper(Object value)
convert this value as a
Boolean. |
static byte |
toByte(BigDecimal decimal) |
static Byte |
toByte(Object value)
convert this value as a primitive byte.
|
static byte[] |
toBytes(Object value)
convert this value as a byte[].
|
static char |
toCharacter(Object value)
convert this value as a primitive char.
|
static Double |
toDouble(Object value)
convert this value as a primitive double.
|
static Float |
toFloat(Object value)
convert this value as a Float.
|
static int |
toInt(BigDecimal decimal) |
static Integer |
toInt(Object value)
convert this value as a primitive integer.
|
static JsonArray |
toJsonArray(Object value)
Convenience method to get the specified value as a JsonArray.
|
static JsonObject |
toJsonObject(Object value)
Convenience method to get the specified value as a JsonObject.
|
static <T> List<T> |
toList(Object value)
Convenience method to get the specified value as a List.
|
static long |
toLong(BigDecimal decimal) |
static Long |
toLong(Object value)
convert this value as a primitive Long.
|
static Number |
toNumber(Object value)
convert this value as a Number.
|
static short |
toShort(BigDecimal decimal) |
static Short |
toShort(Object value)
convert this value as a primitive Short.
|
static String |
toString(Object value)
convert this value to a String.
|
public static boolean isPrimitiveOrString(Object value)
value - source valuepublic static boolean isString(Object value)
value - source valuepublic static String toString(Object value)
value - source valuepublic static boolean isBoolean(Object value)
value - source valuepublic static Boolean toBooleanWrapper(Object value)
Boolean.value - source valueBoolean.public static boolean toBoolean(Object value)
value - source valuepublic static boolean isNumber(Object value)
value - source valuepublic static Number toNumber(Object value)
value - source valueNumberFormatException - if the value contained is not a valid
Number.public static Double toDouble(Object value)
value - source valueNumberFormatException - if the value contained is not a valid
double.public static BigDecimal toBigDecimal(Object value)
BigDecimal.value - source valueBigDecimal.NumberFormatException - if the value contained is not a valid
BigDecimal.public static BigInteger toBigInteger(Object value)
BigInteger.value - source valueBigInteger.NumberFormatException - if the value contained is not a valid
BigInteger.public static Float toFloat(Object value)
value - source valueNumberFormatException - if the value contained is not a valid
Float.public static Long toLong(Object value)
value - source valueNumberFormatException - if the value contained is not a valid Long.public static Short toShort(Object value)
value - source valueNumberFormatException - if the value contained is not a valid Short
value.public static Integer toInt(Object value)
value - source valueNumberFormatException - if the value contained is not a valid
integer.public static Byte toByte(Object value)
value - source valueNumberFormatException - if the value contained is not a valid byte.public static byte[] toBytes(Object value)
value - source valueNumberFormatException - if the value contained is not a valid
byte[].public static char toCharacter(Object value)
value - source valueIndexOutOfBoundsException - if the index argument is
negative or not less than the length of this string.public static byte toByte(BigDecimal decimal)
public static short toShort(BigDecimal decimal)
public static int toInt(BigDecimal decimal)
public static long toLong(BigDecimal decimal)
public static <T> List<T> toList(Object value)
value - source value.public static JsonArray toJsonArray(Object value)
value - source value.public static JsonObject toJsonObject(Object value)
value - source value.Copyright © 2018–2020 Pivotal Software, Inc.. All rights reserved.