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, 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 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 byte convertToByte(String value)
convertToBoolean
public static boolean convertToBoolean(String value)
convertToChar
public static char convertToChar(String value)
convertToDouble
public static double convertToDouble(String value)
convertToFloat
public static float convertToFloat(String value)
convertToInt
public static int convertToInt(String value)
convertToLong
public static long convertToLong(String value)
convertToShort
public static short convertToShort(String value)
convertToByteObject
public static Byte convertToByteObject(String value)
convertToBooleanObject
public static Boolean convertToBooleanObject(String value)
convertToCharacterObject
public static Character convertToCharacterObject(String value)
convertToDoubleObject
public static Double convertToDoubleObject(String value)
convertToFloatObject
public static Float convertToFloatObject(String value)
convertToIntegerObject
public static Integer convertToIntegerObject(String value)
convertToLongObject
public static Long convertToLongObject(String value)
convertToShortObject
public static Short convertToShortObject(String value)
toString
public String toString()
- Overrides:
toString
in class Object