Package org.apache.calcite.rel.type
Class RelDataTypeFactoryImpl.JavaType
- java.lang.Object
-
- org.apache.calcite.rel.type.RelDataTypeImpl
-
- org.apache.calcite.rel.type.RelDataTypeFactoryImpl.JavaType
-
- All Implemented Interfaces:
RelDataType
,RelDataTypeFamily
- Enclosing class:
- RelDataTypeFactoryImpl
public class RelDataTypeFactoryImpl.JavaType extends RelDataTypeImpl
Type which is based upon a Java class.
-
-
Field Summary
Fields Modifier and Type Field Description private java.nio.charset.Charset
charset
private java.lang.Class
clazz
private SqlCollation
collation
private boolean
nullable
-
Fields inherited from class org.apache.calcite.rel.type.RelDataTypeImpl
digest, fieldList
-
Fields inherited from interface org.apache.calcite.rel.type.RelDataType
PRECISION_NOT_SPECIFIED, SCALE_NOT_SPECIFIED
-
-
Constructor Summary
Constructors Constructor Description JavaType(java.lang.Class clazz)
JavaType(java.lang.Class clazz, boolean nullable)
JavaType(java.lang.Class clazz, boolean nullable, java.nio.charset.Charset charset, SqlCollation collation)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
generateTypeString(java.lang.StringBuilder sb, boolean withDetail)
Generates a string representation of this type.java.nio.charset.Charset
getCharset()
Gets this type's character set, or null if this type cannot carry a character set or has no character set defined.SqlCollation
getCollation()
Gets this type's collation, or null if this type cannot carry a collation or has no collation defined.RelDataType
getComponentType()
Gets the component type if this type is a collection, otherwise null.RelDataTypeFamily
getFamily()
Gets a canonical object representing the family of this type.java.lang.Class
getJavaClass()
SqlTypeName
getSqlTypeName()
Gets theSqlTypeName
of this type.boolean
isNullable()
Queries whether this type allows null values.-
Methods inherited from class org.apache.calcite.rel.type.RelDataTypeImpl
computeDigest, equals, extra, getComparability, getField, getFieldCount, getFieldList, getFieldNames, getFullTypeString, getIntervalQualifier, getKeyType, getPrecedenceList, getPrecision, getScale, getSqlIdentifier, getStructKind, getValueType, hashCode, isDynamicStruct, isStruct, proto, proto, proto, proto, toString
-
-
-
-
Field Detail
-
clazz
private final java.lang.Class clazz
-
nullable
private final boolean nullable
-
collation
private SqlCollation collation
-
charset
private java.nio.charset.Charset charset
-
-
Constructor Detail
-
JavaType
public JavaType(java.lang.Class clazz)
-
JavaType
public JavaType(java.lang.Class clazz, boolean nullable)
-
JavaType
public JavaType(java.lang.Class clazz, boolean nullable, java.nio.charset.Charset charset, SqlCollation collation)
-
-
Method Detail
-
getJavaClass
public java.lang.Class getJavaClass()
-
isNullable
public boolean isNullable()
Description copied from interface:RelDataType
Queries whether this type allows null values.- Specified by:
isNullable
in interfaceRelDataType
- Overrides:
isNullable
in classRelDataTypeImpl
- Returns:
- whether type allows null values
-
getFamily
public RelDataTypeFamily getFamily()
Description copied from interface:RelDataType
Gets a canonical object representing the family of this type. Two values can be compared if and only if their types are in the same family.- Specified by:
getFamily
in interfaceRelDataType
- Overrides:
getFamily
in classRelDataTypeImpl
- Returns:
- canonical object representing type family
-
generateTypeString
protected void generateTypeString(java.lang.StringBuilder sb, boolean withDetail)
Description copied from class:RelDataTypeImpl
Generates a string representation of this type.- Specified by:
generateTypeString
in classRelDataTypeImpl
- Parameters:
sb
- StringBuffer into which to generate the stringwithDetail
- when true, all detail information needed to compute a unique digest (and return from getFullTypeString) should be included;
-
getComponentType
public RelDataType getComponentType()
Description copied from interface:RelDataType
Gets the component type if this type is a collection, otherwise null.- Specified by:
getComponentType
in interfaceRelDataType
- Overrides:
getComponentType
in classRelDataTypeImpl
- Returns:
- canonical type descriptor for components
-
getCharset
public java.nio.charset.Charset getCharset()
Description copied from interface:RelDataType
Gets this type's character set, or null if this type cannot carry a character set or has no character set defined.- Specified by:
getCharset
in interfaceRelDataType
- Overrides:
getCharset
in classRelDataTypeImpl
- Returns:
- charset of type
-
getCollation
public SqlCollation getCollation()
Description copied from interface:RelDataType
Gets this type's collation, or null if this type cannot carry a collation or has no collation defined.- Specified by:
getCollation
in interfaceRelDataType
- Overrides:
getCollation
in classRelDataTypeImpl
- Returns:
- collation of type
-
getSqlTypeName
public SqlTypeName getSqlTypeName()
Description copied from interface:RelDataType
Gets theSqlTypeName
of this type.- Specified by:
getSqlTypeName
in interfaceRelDataType
- Overrides:
getSqlTypeName
in classRelDataTypeImpl
- Returns:
- SqlTypeName, or null if this is not an SQL predefined type
-
-