Package org.h2.value
Class ExtTypeInfoEnum
java.lang.Object
org.h2.value.ExtTypeInfo
org.h2.value.ExtTypeInfoEnum
- All Implemented Interfaces:
HasSQL
Extended parameters of the ENUM data type.
-
Field Summary
FieldsFields inherited from interface org.h2.util.HasSQL
ADD_PLAN_INFORMATION, DEFAULT_SQL_FLAGS, NO_CASTS, QUOTE_ONLY_WHEN_REQUIRED, REPLACE_LOBS_FOR_TRACE, TRACE_SQL_FLAGS
-
Constructor Summary
ConstructorsConstructorDescriptionExtTypeInfoEnum
(String[] enumerators) Creates new instance of extended parameters of the ENUM data type. -
Method Summary
Modifier and TypeMethodDescriptionboolean
int
getCount()
Get count of elements in enumeration.getEnumerator
(int ordinal) Returns an enumerator with specified 0-based ordinal value.static ExtTypeInfoEnum
getEnumeratorsForBinaryOperation
(Value left, Value right) Returns enumerators for the two specified values for a binary operation.getSQL
(StringBuilder builder, int sqlFlags) Appends the SQL statement of this object to the specified builder.(package private) TypeInfo
getType()
getValue
(int ordinal, CastDataProvider provider) Get ValueEnum instance for an ordinal.getValue
(String label, CastDataProvider provider) Get ValueEnum instance for a label string.private ValueEnum
getValueOrNull
(String label, CastDataProvider provider) int
hashCode()
private static String
private static StringBuilder
toSQL
(StringBuilder builder, String[] enumerators) Methods inherited from class org.h2.value.ExtTypeInfo
toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.h2.util.HasSQL
getSQL, getTraceSQL
-
Field Details
-
enumerators
-
cleaned
-
type
-
-
Constructor Details
-
ExtTypeInfoEnum
Creates new instance of extended parameters of the ENUM data type.- Parameters:
enumerators
- the enumerators. May not be modified by caller or this class.
-
-
Method Details
-
getEnumeratorsForBinaryOperation
Returns enumerators for the two specified values for a binary operation.- Parameters:
left
- left (first) operandright
- right (second) operand- Returns:
- enumerators from the left or the right value, or an empty array if both values do not have enumerators
-
sanitize
-
toSQL
-
getType
TypeInfo getType() -
getCount
public int getCount()Get count of elements in enumeration.- Returns:
- count of elements in enumeration
-
getEnumerator
Returns an enumerator with specified 0-based ordinal value.- Parameters:
ordinal
- ordinal value of an enumerator- Returns:
- the enumerator with specified ordinal value
-
getValue
Get ValueEnum instance for an ordinal.- Parameters:
ordinal
- ordinal value of an enumprovider
- the cast information provider- Returns:
- ValueEnum instance
-
getValue
Get ValueEnum instance for a label string.- Parameters:
label
- label stringprovider
- the cast information provider- Returns:
- ValueEnum instance
-
getValueOrNull
-
hashCode
public int hashCode() -
equals
-
getSQL
Description copied from interface:HasSQL
Appends the SQL statement of this object to the specified builder.- Parameters:
builder
- string buildersqlFlags
- formatting flags- Returns:
- the specified string builder
-