Class TypeFacility


  • public class TypeFacility
    extends Object
    • Constructor Detail

      • TypeFacility

        public TypeFacility()
    • Method Detail

      • getDataTypeClass

        public static Class<?> getDataTypeClass​(String type)
        Get the Class constant for the given String runtime type name
        IMPORTANT: only considered the default runtime types
      • getDataTypeName

        public static String getDataTypeName​(Class<?> type)
        Get the String constant for the given runtime type class
      • getRuntimeType

        public static Class<?> getRuntimeType​(Class<?> type)
        Get the closest runtime type for the given class
      • getSQLTypeFromRuntimeType

        public static final int getSQLTypeFromRuntimeType​(Class<?> type)
        Get the SQL type for the given runtime type Class constant
        Parameters:
        type -
        Returns:
      • getDataTypeNameFromSQLType

        public static final String getDataTypeNameFromSQLType​(int sqlType)
        Get the runtime type name for the given SQL type
        Parameters:
        sqlType -
        Returns:
      • convertDate

        public 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.
        Parameters:
        date -
        initial -
        target -
        targetType -
        Returns:
      • convertPrimitiveToObject

        public static Class<?> convertPrimitiveToObject​(Class<?> clazz)
        Convert a primitive class to the corresponding object class
        Parameters:
        clazz -
        Returns: