Class DataTypes

java.lang.Object
smile.data.type.DataTypes

public class DataTypes extends Object
To get a specific data type, users should use singleton objects and factory methods in this class.
  • Field Details

    • BooleanType

      public static BooleanType BooleanType
      Boolean data type.
    • CharType

      public static CharType CharType
      Char data type.
    • ByteType

      public static ByteType ByteType
      Byte data type.
    • ShortType

      public static ShortType ShortType
      Short data type.
    • IntegerType

      public static IntegerType IntegerType
      Integer data type.
    • LongType

      public static LongType LongType
      Long data type.
    • FloatType

      public static FloatType FloatType
      Float data type.
    • DoubleType

      public static DoubleType DoubleType
      Double data type.
    • DecimalType

      public static DecimalType DecimalType
      Decimal data type.
    • StringType

      public static StringType StringType
      String data type.
    • DateType

      public static DateType DateType
      Date data type with ISO format.
    • DateTimeType

      public static DateTimeType DateTimeType
      DateTime data type with ISO format.
    • TimeType

      public static TimeType TimeType
      Time data type with ISO format.
    • ObjectType

      public static ObjectType ObjectType
      Plain Object data type.
    • BooleanObjectType

      public static ObjectType BooleanObjectType
      Boolean Object data type.
    • CharObjectType

      public static ObjectType CharObjectType
      Char Object data type.
    • ByteObjectType

      public static ObjectType ByteObjectType
      Byte Object data type.
    • ShortObjectType

      public static ObjectType ShortObjectType
      Short Object data type.
    • IntegerObjectType

      public static ObjectType IntegerObjectType
      Integer Object data type.
    • LongObjectType

      public static ObjectType LongObjectType
      Long Object data type.
    • FloatObjectType

      public static ObjectType FloatObjectType
      Float Object data type.
    • DoubleObjectType

      public static ObjectType DoubleObjectType
      Double Object data type.
    • BooleanArrayType

      public static ArrayType BooleanArrayType
      Boolean Array data type.
    • CharArrayType

      public static ArrayType CharArrayType
      Char Array data type.
    • ByteArrayType

      public static ArrayType ByteArrayType
      Byte Array data type.
    • ShortArrayType

      public static ArrayType ShortArrayType
      Short Array data type.
    • IntegerArrayType

      public static ArrayType IntegerArrayType
      Integer Array data type.
    • LongArrayType

      public static ArrayType LongArrayType
      Long Array data type.
    • FloatArrayType

      public static ArrayType FloatArrayType
      Float Array data type.
    • DoubleArrayType

      public static ArrayType DoubleArrayType
      Double Array data type.
  • Constructor Details

    • DataTypes

      public DataTypes()
  • Method Details

    • date

      public static DateType date(String pattern)
      Date data type with customized format.
      Parameters:
      pattern - the date regex pattern.
      Returns:
      the Date type.
    • time

      public static TimeType time(String pattern)
      Time data type with customized format.
      Parameters:
      pattern - the time regex pattern.
      Returns:
      the Time type.
    • datetime

      public static DateTimeType datetime(String pattern)
      DateTime data type with customized format.
      Parameters:
      pattern - the date time regex pattern.
      Returns:
      the DateTime type.
    • object

      public static DataType object(Class<?> clazz)
      Creates an object data type of a given class.
      Parameters:
      clazz - the object class.
      Returns:
      the object data type.
    • array

      public static ArrayType array(DataType type)
      Creates an array data type.
      Parameters:
      type - the data type of array elements.
      Returns:
      the array data type.
    • struct

      public static StructType struct(StructField... fields)
      Creates a struct data type.
      Parameters:
      fields - the struct fields.
      Returns:
      the struct data type.
    • struct

      public static StructType struct(List<StructField> fields)
      Creates a struct data type.
      Parameters:
      fields - the struct fields.
      Returns:
      the struct data type.
    • struct

      public static StructType struct(ResultSet rs) throws SQLException
      Creates a struct data type from JDBC result set meta data.
      Parameters:
      rs - the JDBC result set.
      Returns:
      the struct data type.
      Throws:
      SQLException - when JDBC operation fails.
    • struct

      public static StructType struct(ResultSetMetaData meta, String dbms) throws SQLException
      Creates a struct data type from JDBC result set meta data.
      Parameters:
      meta - the JDBC result set meta data.
      dbms - the name of database management system.
      Returns:
      the struct data type.
      Throws:
      SQLException - when JDBC operation fails.