Package org.apache.calcite.sql.type
Class SqlTypeAssignmentRules
- java.lang.Object
-
- org.apache.calcite.sql.type.SqlTypeAssignmentRules
-
public class SqlTypeAssignmentRules extends java.lang.Object
Rules that determine whether a type is assignable from another type.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
SqlTypeAssignmentRules.Builder
Keeps state while maps are building build.
-
Field Summary
Fields Modifier and Type Field Description private static SqlTypeAssignmentRules
COERCE_INSTANCE
private static SqlTypeAssignmentRules
INSTANCE
private java.util.Map<SqlTypeName,com.google.common.collect.ImmutableSet<SqlTypeName>>
map
-
Constructor Summary
Constructors Modifier Constructor Description private
SqlTypeAssignmentRules(java.util.Map<SqlTypeName,com.google.common.collect.ImmutableSet<SqlTypeName>> map)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
canCastFrom(SqlTypeName to, SqlTypeName from)
Returns whether it is valid to cast a value of from typefrom
to typeto
.boolean
canCastFrom(SqlTypeName to, SqlTypeName from, boolean coerce)
Deprecated.static SqlTypeAssignmentRules
instance()
Returns an instance that does not coerce.static SqlTypeAssignmentRules
instance(boolean coerce)
Returns an instance.
-
-
-
Field Detail
-
INSTANCE
private static final SqlTypeAssignmentRules INSTANCE
-
COERCE_INSTANCE
private static final SqlTypeAssignmentRules COERCE_INSTANCE
-
map
private final java.util.Map<SqlTypeName,com.google.common.collect.ImmutableSet<SqlTypeName>> map
-
-
Constructor Detail
-
SqlTypeAssignmentRules
private SqlTypeAssignmentRules(java.util.Map<SqlTypeName,com.google.common.collect.ImmutableSet<SqlTypeName>> map)
-
-
Method Detail
-
instance
public static SqlTypeAssignmentRules instance()
Returns an instance that does not coerce.
-
instance
public static SqlTypeAssignmentRules instance(boolean coerce)
Returns an instance.
-
canCastFrom
@Deprecated public boolean canCastFrom(SqlTypeName to, SqlTypeName from, boolean coerce)
Deprecated.
-
canCastFrom
public boolean canCastFrom(SqlTypeName to, SqlTypeName from)
Returns whether it is valid to cast a value of from typefrom
to typeto
.
-
-