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 final BooleanType BooleanType
      Boolean data type.
    • CharType

      public static final CharType CharType
      Char data type.
    • ByteType

      public static final ByteType ByteType
      Byte data type.
    • ShortType

      public static final ShortType ShortType
      Short data type.
    • IntegerType

      public static final IntegerType IntegerType
      Integer data type.
    • LongType

      public static final LongType LongType
      Long data type.
    • FloatType

      public static final FloatType FloatType
      Float data type.
    • DoubleType

      public static final DoubleType DoubleType
      Double data type.
    • DecimalType

      public static final DecimalType DecimalType
      Decimal data type.
    • StringType

      public static final StringType StringType
      String data type.
    • DateType

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

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

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

      public static final ObjectType ObjectType
      Plain Object data type.
    • BooleanObjectType

      public static final ObjectType BooleanObjectType
      Boolean Object data type.
    • CharObjectType

      public static final ObjectType CharObjectType
      Char Object data type.
    • ByteObjectType

      public static final ObjectType ByteObjectType
      Byte Object data type.
    • ShortObjectType

      public static final ObjectType ShortObjectType
      Short Object data type.
    • IntegerObjectType

      public static final ObjectType IntegerObjectType
      Integer Object data type.
    • LongObjectType

      public static final ObjectType LongObjectType
      Long Object data type.
    • FloatObjectType

      public static final ObjectType FloatObjectType
      Float Object data type.
    • DoubleObjectType

      public static final ObjectType DoubleObjectType
      Double Object data type.
    • BooleanArrayType

      public static final ArrayType BooleanArrayType
      Boolean Array data type.
    • CharArrayType

      public static final ArrayType CharArrayType
      Char Array data type.
    • ByteArrayType

      public static final ArrayType ByteArrayType
      Byte Array data type.
    • ShortArrayType

      public static final ArrayType ShortArrayType
      Short Array data type.
    • IntegerArrayType

      public static final ArrayType IntegerArrayType
      Integer Array data type.
    • LongArrayType

      public static final ArrayType LongArrayType
      Long Array data type.
    • FloatArrayType

      public static final ArrayType FloatArrayType
      Float Array data type.
    • DoubleArrayType

      public static final 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 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.