org.apache.beehive.netui.util.type
Class TypeUtils
Object
TypeUtils
public final class TypeUtils
- extends Object
Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
convertToObject
public static final Object convertToObject(String value,
Class type)
- Deprecated.
- Convert an object from a String to the given type.
- Parameters:
value
- the String to converttype
- the type to which to convert the String
- Returns:
- the Object result of converting the String to the type.
- Throws:
TypeConverterNotFoundException
- if a TypeConverter for the target type can not be found.
convertToObject
public static final Object convertToObject(String value,
Class type,
Locale locale)
- Convert an object from a String to the given type using the specified
Locale
.
The locale is optionally used depending on the implementation of the TypeConverter
that is used.
- Parameters:
value
- the String to converttype
- the type to which to convert the Stringlocale
- the locale to use during conversion
- Returns:
- the Object result of converting the String to the type.
- Throws:
TypeConverterNotFoundException
- if a TypeConverter for the target type can not be found.
convertToByte
public static final byte convertToByte(String value)
convertToBoolean
public static final boolean convertToBoolean(String value)
convertToChar
public static final char convertToChar(String value)
convertToDouble
public static final double convertToDouble(String value)
convertToFloat
public static final float convertToFloat(String value)
convertToInt
public static final int convertToInt(String value)
convertToLong
public static final long convertToLong(String value)
convertToShort
public static final short convertToShort(String value)
convertToByteObject
public static final Byte convertToByteObject(String value)
convertToBooleanObject
public static final Boolean convertToBooleanObject(String value)
convertToCharacterObject
public static final Character convertToCharacterObject(String value)
convertToDoubleObject
public static final Double convertToDoubleObject(String value)
convertToFloatObject
public static final Float convertToFloatObject(String value)
convertToIntegerObject
public static final Integer convertToIntegerObject(String value)
convertToLongObject
public static final Long convertToLongObject(String value)
convertToShortObject
public static final Short convertToShortObject(String value)