Class TypeConversionHelper
- java.lang.Object
-
- org.datanucleus.store.types.converters.TypeConversionHelper
-
public class TypeConversionHelper extends Object
Class with methods for type conversion.
-
-
Constructor Summary
Constructors Constructor Description TypeConversionHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Object
convertTo(Object value, Class type)
Convert the value to a instance of the given type.
-
-
-
Method Detail
-
convertTo
public static Object convertTo(Object value, Class type)
Convert the value to a instance of the given type. The value is converted only if the type can't be assigned from the current type of the value instance.- Parameters:
value
- the value to be convertedtype
- the type of the expected object returned from the conversion- Returns:
- the converted object, or the input value if the object can't be converted
-
-