public interface FieldDef
All supported data types are represented as instances of FieldDef.
Supported types are defined in the enumeration Type
.
Instances of FieldDef are created when defining the fields for a new
Table
, or during query processing.
Each instance has these properties:
FieldDef.Type
enum.
Modifier and Type | Interface and Description |
---|---|
static class |
FieldDef.Type
The type of a field definition.
|
Modifier and Type | Method and Description |
---|---|
AnyDef |
asAny()
Casts to AnyDef.
|
AnyAtomicDef |
asAnyAtomic()
Casts to AnyAtomicDef.
|
AnyJsonAtomicDef |
asAnyJsonAtomic()
Casts to AnyJsonAtomicDef.
|
AnyRecordDef |
asAnyRecord()
Casts to AnyRecordDef.
|
ArrayDef |
asArray()
Casts to ArrayDef.
|
BinaryDef |
asBinary()
Casts to BinaryDef.
|
BooleanDef |
asBoolean()
Casts to BooleanDef.
|
DoubleDef |
asDouble()
Casts to DoubleDef.
|
EnumDef |
asEnum()
Casts to EnumDef.
|
FixedBinaryDef |
asFixedBinary()
Casts to FixedBinaryDef.
|
FloatDef |
asFloat()
Casts to FloatDef.
|
IntegerDef |
asInteger()
Casts to IntegerDef.
|
JsonDef |
asJson()
Casts to JsonDef.
|
LongDef |
asLong()
Casts to LongDef.
|
MapDef |
asMap()
Casts to MapDef.
|
NumberDef |
asNumber()
Casts to NumberDef.
|
RecordDef |
asRecord()
Casts to RecordDef.
|
StringDef |
asString()
Casts to StringDef.
|
TimestampDef |
asTimestamp()
Casts to TimestampDef.
|
FieldDef |
clone()
Perform a deep copy of this FieldDef instance.
|
ArrayValue |
createArray()
Creates an empty ArrayValue.
|
BinaryValue |
createBinary(byte[] value)
Creates a BinaryValue instance based on the value.
|
BooleanValue |
createBoolean(boolean value)
Creates a BooleanValue instance based on the value.
|
DoubleValue |
createDouble(double value)
Creates a DoubleValue instance based on the value.
|
EnumValue |
createEnum(String value)
Creates an EnumValue instance based on the value.
|
FixedBinaryValue |
createFixedBinary(byte[] value)
Creates a FixedBinaryValue instance based on the value.
|
FloatValue |
createFloat(float value)
Creates a FloatValue instance based on the value.
|
IntegerValue |
createInteger(int value)
Creates an IntegerValue instance based on the value.
|
FieldValue |
createJsonNull()
Creates a special FieldValue instance representing a JSON null.
|
LongValue |
createLong(long value)
Creates a LongValue instance based on the value.
|
MapValue |
createMap()
Creates an empty MapValue.
|
NumberValue |
createNumber(BigDecimal value)
Creates a NumberValue instance based on the value
|
NumberValue |
createNumber(double value)
Creates a NumberValue instance based on the value
|
NumberValue |
createNumber(float value)
Creates a NumberValue instance based on the value
|
NumberValue |
createNumber(int value)
Creates a NumberValue instance based on the value
|
NumberValue |
createNumber(long value)
Creates a NumberValue instance based on the value
|
RecordValue |
createRecord()
Creates an empty RecordValue.
|
StringValue |
createString(String value)
Creates a StringValue instance based on the value.
|
TimestampValue |
createTimestamp(Timestamp value)
Creates a TimestampValue instance based on the value.
|
String |
getDescription()
Returns the description of the field.
|
FieldDef.Type |
getType()
Returns the type of the field.
|
boolean |
isAny()
Returns true if this is an
AnyDef . |
boolean |
isAnyAtomic()
Returns true if this is an
AnyAtomicDef . |
boolean |
isAnyJsonAtomic()
Returns true if this is an
AnyJsonAtomicDef . |
boolean |
isAnyRecord()
Returns true if this is an
AnyRecordDef . |
boolean |
isArray()
Returns true if this is an
ArrayDef . |
boolean |
isAtomic()
Returns true if this is an atomic type.
|
boolean |
isBinary()
Returns true if this is a
BinaryDef . |
boolean |
isBoolean()
Returns true if this is a
BooleanDef . |
boolean |
isComplex()
Returns true if this is a complex type.
|
boolean |
isDouble()
Returns true if this is a
DoubleDef . |
boolean |
isEnum()
Returns true if this is an
EnumDef . |
boolean |
isFixedBinary()
Returns true if this is a
FixedBinaryDef . |
boolean |
isFloat()
Returns true if this is a
FloatDef . |
boolean |
isInteger()
Returns true if this is an
IntegerDef . |
boolean |
isJson()
Returns true if this is a JSON type.
|
boolean |
isLong()
Returns true if this is a
LongDef . |
boolean |
isMap()
Returns true if this is a
MapDef . |
boolean |
isNumber()
Returns true if this is a
NumberDef . |
boolean |
isNumeric()
Returns true if this is a numeric type.
|
boolean |
isRecord()
Returns true if this is a
RecordDef . |
boolean |
isString()
Returns true if this is a
StringDef . |
boolean |
isTimestamp()
Returns true if this is a
TimestampDef . |
boolean |
isType(FieldDef.Type type)
Returns true if the type of this field matches the parameter.
|
boolean |
isValidIndexField() |
boolean |
isValidKeyField() |
FieldDef clone()
String getDescription()
FieldDef.Type getType()
boolean isType(FieldDef.Type type)
boolean isValidKeyField()
boolean isValidIndexField()
boolean isAny()
AnyDef
.boolean isAnyRecord()
AnyRecordDef
.boolean isAnyAtomic()
AnyAtomicDef
.boolean isNumber()
NumberDef
.boolean isAnyJsonAtomic()
AnyJsonAtomicDef
.boolean isBoolean()
BooleanDef
.boolean isBinary()
BinaryDef
.boolean isDouble()
DoubleDef
.boolean isEnum()
EnumDef
.boolean isFixedBinary()
FixedBinaryDef
.boolean isFloat()
FloatDef
.boolean isInteger()
IntegerDef
.boolean isLong()
LongDef
.boolean isString()
StringDef
.boolean isTimestamp()
TimestampDef
.boolean isArray()
ArrayDef
.boolean isMap()
MapDef
.boolean isRecord()
RecordDef
.boolean isJson()
boolean isAtomic()
boolean isNumeric()
boolean isComplex()
AnyDef asAny()
ClassCastException
- if this is not an AnyDefAnyRecordDef asAnyRecord()
ClassCastException
- if this is not an AnyRecordDefAnyAtomicDef asAnyAtomic()
ClassCastException
- if this is not an AnyAtomicDefAnyJsonAtomicDef asAnyJsonAtomic()
ClassCastException
- if this is not an AnyJsonAtomicDefBinaryDef asBinary()
ClassCastException
- if this is not a BinaryDefNumberDef asNumber()
ClassCastException
- if this is not a NumberDefBooleanDef asBoolean()
ClassCastException
- if this is not a BooleanDefDoubleDef asDouble()
ClassCastException
- if this is not a DoubleDefEnumDef asEnum()
ClassCastException
- if this is not an EnumDefFixedBinaryDef asFixedBinary()
ClassCastException
- if this is not a FixedBinaryDefFloatDef asFloat()
ClassCastException
- if this is not a FloatDefIntegerDef asInteger()
ClassCastException
- if this is not an IntegerDefLongDef asLong()
ClassCastException
- if this is not a LongDefStringDef asString()
ClassCastException
- if this is not a StringDefTimestampDef asTimestamp()
ClassCastException
- if this is not a TimestampDefArrayDef asArray()
ClassCastException
- if this is not an ArrayDefMapDef asMap()
ClassCastException
- if this is not a MapDefRecordDef asRecord()
ClassCastException
- if this is not a RecordDefJsonDef asJson()
ClassCastException
- if this is not a JsonDefArrayValue createArray()
IllegalArgumentException
- if this instance is not able to create
an ArrayValueNumberValue createNumber(int value)
value
- the value to useIllegalArgumentException
- if this instance is not able to create
a NumberValueNumberValue createNumber(long value)
value
- the value to useIllegalArgumentException
- if this instance is not able to create
a NumberValueNumberValue createNumber(float value)
value
- the value to useIllegalArgumentException
- if this instance is not able to create
a NumberValueNumberValue createNumber(double value)
value
- the value to useIllegalArgumentException
- if this instance is not able to create
a NumberValueNumberValue createNumber(BigDecimal value)
value
- a non-null BigDecimal valueIllegalArgumentException
- if this instance is not able to create
a NumberValueBinaryValue createBinary(byte[] value)
value
- the byte array to use for the new value object. Must not
be null.IllegalArgumentException
- if this instance is not able to create a
BinaryValue or if the value is nullBooleanValue createBoolean(boolean value)
value
- the value to useIllegalArgumentException
- if this instance is not able to create
a BooleanValueDoubleValue createDouble(double value)
value
- the value to useIllegalArgumentException
- if this instance is not able to create
a DoubleValueEnumValue createEnum(String value)
value
- the value to useIllegalArgumentException
- if this instance is not able to create
an EnumValue or if the value is not valid for the definitionFixedBinaryValue createFixedBinary(byte[] value)
value
- the value to use. It must not be null.IllegalArgumentException
- if this instance is not able to create a
FixedBinaryValue or if the value is null or not valid for the definitionFloatValue createFloat(float value)
value
- the value to useIllegalArgumentException
- if this instance is not able to create
a FloatValueIntegerValue createInteger(int value)
value
- the value to useIllegalArgumentException
- if this instance is not able to create
an IntegerValue or if the value is not valid for the definitionLongValue createLong(long value)
value
- the value to useIllegalArgumentException
- if this instance is not able to create
a LongValueTimestampValue createTimestamp(Timestamp value)
value
- the value to useIllegalArgumentException
- if this instance is not able to create
a TimestampValueMapValue createMap()
IllegalArgumentException
- if this instance is not able to create
a MapValueRecordValue createRecord()
IllegalArgumentException
- if this instance is not able to create
a RecordValueStringValue createString(String value)
value
- the value to useIllegalArgumentException
- if this instance is not able to create
a StringValueFieldValue createJsonNull()
FieldValue.isJsonNull()
.IllegalArgumentException
- if this instance is not able to create
a JSON null (is not of type JSON)Copyright (c) 2011, 2017 Oracle and/or its affiliates. All rights reserved.