org.apache.beehive.netui.util.type
Class TypeUtils

Object
  extended by TypeUtils

public final class TypeUtils
extends Object


Method Summary
static boolean convertToBoolean(String value)
           
static Boolean convertToBooleanObject(String value)
           
static byte convertToByte(String value)
           
static Byte convertToByteObject(String value)
           
static char convertToChar(String value)
           
static Character convertToCharacterObject(String value)
           
static double convertToDouble(String value)
           
static Double convertToDoubleObject(String value)
           
static float convertToFloat(String value)
           
static Float convertToFloatObject(String value)
           
static int convertToInt(String value)
           
static Integer convertToIntegerObject(String value)
           
static long convertToLong(String value)
           
static Long convertToLongObject(String value)
           
static Object convertToObject(String value, Class type)
          Deprecated.  
static Object convertToObject(String value, Class type, Locale locale)
          Convert an object from a String to the given type using the specified Locale.
static short convertToShort(String value)
           
static Short convertToShortObject(String value)
           
 String toString()
           
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

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 convert
type - 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 convert
type - the type to which to convert the String
locale - 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