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)
           
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, 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 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 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 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)