Package org.apache.calcite.adapter.csv
Enum CsvFieldType
- java.lang.Object
-
- java.lang.Enum<CsvFieldType>
-
- org.apache.calcite.adapter.csv.CsvFieldType
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<CsvFieldType>
enum CsvFieldType extends java.lang.Enum<CsvFieldType>
Type of a field in a CSV file.Usually, and unless specified explicitly in the header row, a field is of type
STRING
. But specifying the field type in the header row makes it easier to write SQL.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Class
clazz
private static java.util.Map<java.lang.String,CsvFieldType>
MAP
private java.lang.String
simpleName
-
Constructor Summary
Constructors Modifier Constructor Description private
CsvFieldType(java.lang.Class clazz, java.lang.String simpleName)
private
CsvFieldType(Primitive primitive)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CsvFieldType
of(java.lang.String typeString)
RelDataType
toType(JavaTypeFactory typeFactory)
static CsvFieldType
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static CsvFieldType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
STRING
public static final CsvFieldType STRING
-
BOOLEAN
public static final CsvFieldType BOOLEAN
-
BYTE
public static final CsvFieldType BYTE
-
CHAR
public static final CsvFieldType CHAR
-
SHORT
public static final CsvFieldType SHORT
-
INT
public static final CsvFieldType INT
-
LONG
public static final CsvFieldType LONG
-
FLOAT
public static final CsvFieldType FLOAT
-
DOUBLE
public static final CsvFieldType DOUBLE
-
DATE
public static final CsvFieldType DATE
-
TIME
public static final CsvFieldType TIME
-
TIMESTAMP
public static final CsvFieldType TIMESTAMP
-
-
Field Detail
-
clazz
private final java.lang.Class clazz
-
simpleName
private final java.lang.String simpleName
-
MAP
private static final java.util.Map<java.lang.String,CsvFieldType> MAP
-
-
Constructor Detail
-
CsvFieldType
private CsvFieldType(Primitive primitive)
-
CsvFieldType
private CsvFieldType(java.lang.Class clazz, java.lang.String simpleName)
-
-
Method Detail
-
values
public static CsvFieldType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (CsvFieldType c : CsvFieldType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static CsvFieldType valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
toType
public RelDataType toType(JavaTypeFactory typeFactory)
-
of
public static CsvFieldType of(java.lang.String typeString)
-
-