Package org.apache.calcite.avatica
Enum ColumnMetaData.Rep
- java.lang.Object
-
- java.lang.Enum<ColumnMetaData.Rep>
-
- org.apache.calcite.avatica.ColumnMetaData.Rep
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<ColumnMetaData.Rep>
- Enclosing class:
- ColumnMetaData
public static enum ColumnMetaData.Rep extends java.lang.Enum<ColumnMetaData.Rep>
Description of the type used to internally represent a value. For example, aDatemight be represented as aPRIMITIVE_INTif not nullable, or aJAVA_SQL_DATE.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ARRAYBOOLEANBYTEBYTE_STRINGCHARACTERDOUBLEFLOATINTEGERJAVA_SQL_DATEJAVA_SQL_TIMEJAVA_SQL_TIMESTAMPJAVA_UTIL_DATELONGMULTISETNUMBERValues are represented as some sub-class ofNumber.OBJECTPRIMITIVE_BOOLEANPRIMITIVE_BYTEPRIMITIVE_CHARPRIMITIVE_DOUBLEPRIMITIVE_FLOATPRIMITIVE_INTPRIMITIVE_LONGPRIMITIVE_SHORTSHORTSTRINGSTRUCT
-
Field Summary
Fields Modifier and Type Field Description java.lang.ClassclazzinttypeIdstatic java.util.Map<java.lang.Class,ColumnMetaData.Rep>VALUE_MAP
-
Constructor Summary
Constructors Modifier Constructor Description privateRep(java.lang.Class clazz, int typeId)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ColumnMetaData.RepfromProto(Common.Rep proto)java.lang.ObjectjdbcGet(java.sql.ResultSet resultSet, int i)Returns the value of a column of this type from a result set.static ColumnMetaData.RepnonPrimitiveRepOf(SqlType type)Computes the given JDBC type for a primitive to the correspondingColumnMetaData.Repfor the equivalent Object type.static ColumnMetaData.Repof(java.lang.reflect.Type clazz)static ColumnMetaData.RepserialRepOf(SqlType type)Computes the given JDBC type into theColumnMetaData.Repfor the wire (serial) form of that type.Common.ReptoProto()static ColumnMetaData.RepvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static ColumnMetaData.Rep[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
PRIMITIVE_BOOLEAN
public static final ColumnMetaData.Rep PRIMITIVE_BOOLEAN
-
PRIMITIVE_BYTE
public static final ColumnMetaData.Rep PRIMITIVE_BYTE
-
PRIMITIVE_CHAR
public static final ColumnMetaData.Rep PRIMITIVE_CHAR
-
PRIMITIVE_SHORT
public static final ColumnMetaData.Rep PRIMITIVE_SHORT
-
PRIMITIVE_INT
public static final ColumnMetaData.Rep PRIMITIVE_INT
-
PRIMITIVE_LONG
public static final ColumnMetaData.Rep PRIMITIVE_LONG
-
PRIMITIVE_FLOAT
public static final ColumnMetaData.Rep PRIMITIVE_FLOAT
-
PRIMITIVE_DOUBLE
public static final ColumnMetaData.Rep PRIMITIVE_DOUBLE
-
BOOLEAN
public static final ColumnMetaData.Rep BOOLEAN
-
BYTE
public static final ColumnMetaData.Rep BYTE
-
CHARACTER
public static final ColumnMetaData.Rep CHARACTER
-
SHORT
public static final ColumnMetaData.Rep SHORT
-
INTEGER
public static final ColumnMetaData.Rep INTEGER
-
LONG
public static final ColumnMetaData.Rep LONG
-
FLOAT
public static final ColumnMetaData.Rep FLOAT
-
DOUBLE
public static final ColumnMetaData.Rep DOUBLE
-
JAVA_SQL_TIME
public static final ColumnMetaData.Rep JAVA_SQL_TIME
-
JAVA_SQL_TIMESTAMP
public static final ColumnMetaData.Rep JAVA_SQL_TIMESTAMP
-
JAVA_SQL_DATE
public static final ColumnMetaData.Rep JAVA_SQL_DATE
-
JAVA_UTIL_DATE
public static final ColumnMetaData.Rep JAVA_UTIL_DATE
-
BYTE_STRING
public static final ColumnMetaData.Rep BYTE_STRING
-
STRING
public static final ColumnMetaData.Rep STRING
-
NUMBER
public static final ColumnMetaData.Rep NUMBER
Values are represented as some sub-class ofNumber. The JSON encoding does this.
-
ARRAY
public static final ColumnMetaData.Rep ARRAY
-
MULTISET
public static final ColumnMetaData.Rep MULTISET
-
STRUCT
public static final ColumnMetaData.Rep STRUCT
-
OBJECT
public static final ColumnMetaData.Rep OBJECT
-
-
Field Detail
-
clazz
public final java.lang.Class clazz
-
typeId
public final int typeId
-
VALUE_MAP
public static final java.util.Map<java.lang.Class,ColumnMetaData.Rep> VALUE_MAP
-
-
Method Detail
-
values
public static ColumnMetaData.Rep[] 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 (ColumnMetaData.Rep c : ColumnMetaData.Rep.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ColumnMetaData.Rep 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
-
of
public static ColumnMetaData.Rep of(java.lang.reflect.Type clazz)
-
jdbcGet
public java.lang.Object jdbcGet(java.sql.ResultSet resultSet, int i) throws java.sql.SQLExceptionReturns the value of a column of this type from a result set.- Throws:
java.sql.SQLException
-
toProto
public Common.Rep toProto()
-
fromProto
public static ColumnMetaData.Rep fromProto(Common.Rep proto)
-
nonPrimitiveRepOf
public static ColumnMetaData.Rep nonPrimitiveRepOf(SqlType type)
Computes the given JDBC type for a primitive to the correspondingColumnMetaData.Repfor the equivalent Object type. If the provided type is not for a primitive, aColumnMetaData.Repfor the provided Object is returned.- Parameters:
type- The type of a value (based onTypes).- Returns:
- The corresponding non-primitive
ColumnMetaData.Repfor the giventype.
-
serialRepOf
public static ColumnMetaData.Rep serialRepOf(SqlType type)
Computes the given JDBC type into theColumnMetaData.Repfor the wire (serial) form of that type.- Parameters:
type- The type of a value (based onTypes).- Returns:
- The corresponding
ColumnMetaData.Repfor the serial form of thetype.
-
-