public class TypeFacility extends Object
Modifier and Type | Class and Description |
---|---|
static class |
TypeFacility.RUNTIME_CODES |
static class |
TypeFacility.RUNTIME_NAMES |
static interface |
TypeFacility.RUNTIME_TYPES |
Constructor and Description |
---|
TypeFacility() |
Modifier and Type | Method and Description |
---|---|
Object |
convertDate(Date date,
TimeZone initial,
Calendar target,
Class<?> targetType)
Convert the given date to a target type, optionally adjusting its display
for a given target Calendar.
|
static Class<?> |
convertPrimitiveToObject(Class<?> clazz)
Convert a primitive class to the corresponding object class
|
Object |
convertToRuntimeType(Object value)
Convert the given value to the closest runtime type see
TypeFacility.RUNTIME_TYPES |
static Class<?> |
getDataTypeClass(String type)
Get the Class constant for the given String runtime type name
IMPORTANT: only considered the default runtime types |
static String |
getDataTypeName(Class<?> type)
Get the String constant for the given runtime type class
|
static String |
getDataTypeNameFromSQLType(int sqlType)
Get the runtime type name for the given SQL type
|
static Class<?> |
getRuntimeType(Class<?> type)
Get the closest runtime type for the given class
|
static int |
getSQLTypeFromRuntimeType(Class<?> type)
Get the SQL type for the given runtime type Class constant
|
public static Class<?> getDataTypeClass(String type)
public static String getDataTypeName(Class<?> type)
public static Class<?> getRuntimeType(Class<?> type)
public static final int getSQLTypeFromRuntimeType(Class<?> type)
type
- public static final String getDataTypeNameFromSQLType(int sqlType)
sqlType
- public Object convertToRuntimeType(Object value)
TypeFacility.RUNTIME_TYPES
value
- public Object convertDate(Date date, TimeZone initial, Calendar target, Class<?> targetType)
date
- initial
- target
- targetType
- Copyright © 2017 JBoss by Red Hat. All rights reserved.