Package oracle.kv.table
Interface FieldDef
- All Known Subinterfaces:
- AnyAtomicDef,- AnyDef,- AnyJsonAtomicDef,- AnyRecordDef,- ArrayDef,- BinaryDef,- BooleanDef,- DoubleDef,- EnumDef,- FixedBinaryDef,- FloatDef,- IntegerDef,- JsonDef,- LongDef,- MapDef,- NumberDef,- RecordDef,- StringDef,- TimestampDef
public interface FieldDef
FieldDef represents an immutable metadata object used to represent a single
 data type. A data type defines a set of values, which are said to belong to
 or be instances of that data type. Data types are either atomic or
 complex. Atomic types define sets of atomic values, like integers,
 doubles, strings, etc. Complex types represent complex values, i.e., values
 that contain other (nested) values, like records, arrays, and maps.
 
 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:
- type -- the kind of the type (one of the values of the
    FieldDef.Typeenum.
- description -- an optional description used when defining the type.
- Since:
- 3.0
- 
Nested Class SummaryNested Classes
- 
Method SummaryModifier and TypeMethodDescriptionasAny()Casts to AnyDef.Casts to AnyAtomicDef.Casts to AnyJsonAtomicDef.Casts to AnyRecordDef.asArray()Casts to ArrayDef.asBinary()Casts to BinaryDef.Casts to BooleanDef.asDouble()Casts to DoubleDef.asEnum()Casts to EnumDef.Casts to FixedBinaryDef.asFloat()Casts to FloatDef.Casts to IntegerDef.asJson()Casts to JsonDef.asLong()Casts to LongDef.asMap()Casts to MapDef.asNumber()Casts to NumberDef.asRecord()Casts to RecordDef.asString()Casts to StringDef.Casts to TimestampDef.clone()Perform a deep copy of this FieldDef instance.Creates an empty ArrayValue.createBinary(byte[] value) Creates a BinaryValue instance based on the value.createBoolean(boolean value) Creates a BooleanValue instance based on the value.createDouble(double value) Creates a DoubleValue instance based on the value.createEnum(String value) Creates an EnumValue instance based on the value.createFixedBinary(byte[] value) Creates a FixedBinaryValue instance based on the value.createFloat(float value) Creates a FloatValue instance based on the value.createInteger(int value) Creates an IntegerValue instance based on the value.Creates a special FieldValue instance representing a JSON null.createLong(long value) Creates a LongValue instance based on the value.Creates an empty MapValue.createNumber(double value) Creates a NumberValue instance based on the valuecreateNumber(float value) Creates a NumberValue instance based on the valuecreateNumber(int value) Creates a NumberValue instance based on the valuecreateNumber(long value) Creates a NumberValue instance based on the valuecreateNumber(BigDecimal value) Creates a NumberValue instance based on the valueCreates an empty RecordValue.createString(String value) Creates a StringValue instance based on the value.createTimestamp(Timestamp value) Creates a TimestampValue instance based on the value.Returns the description of the field.getType()Returns the type of the field.booleanisAny()Returns true if this is anAnyDef.booleanReturns true if this is anAnyAtomicDef.booleanReturns true if this is anAnyJsonAtomicDef.booleanReturns true if this is anAnyRecordDef.booleanisArray()Returns true if this is anArrayDef.booleanisAtomic()Returns true if this is an atomic type.booleanisBinary()Returns true if this is aBinaryDef.booleanReturns true if this is aBooleanDef.booleanReturns true if this is a complex type.booleanisDouble()Returns true if this is aDoubleDef.booleanisEnum()Returns true if this is anEnumDef.booleanReturns true if this is aFixedBinaryDef.booleanisFloat()Returns true if this is aFloatDef.booleanReturns true if this is anIntegerDef.booleanisJson()Returns true if this is a JSON type.booleanisLong()Returns true if this is aLongDef.booleanisMap()Returns true if this is aMapDef.default booleanReturns true if this is a multi-region counter.booleanisNumber()Returns true if this is aNumberDef.booleanReturns true if this is a numeric type.booleanbooleanisRecord()Returns true if this is aRecordDef.booleanisString()Returns true if this is aStringDef.booleanReturns true if this is aTimestampDef.booleanisType(FieldDef.Type type) Returns true if the type of this field matches the parameter.booleanReturns true if this is a STRING AS UUID typebooleanboolean
- 
Method Details- 
cloneFieldDef clone()Perform a deep copy of this FieldDef instance.- Returns:
- a new instance equal to this
 
- 
getDescriptionString getDescription()Returns the description of the field.- Returns:
- the description of the field if set, otherwise null
 
- 
getTypeFieldDef.Type getType()Returns the type of the field.- Returns:
- the type of the field
 
- 
isTypeReturns true if the type of this field matches the parameter.- Returns:
- true if the type of this field matches the parameter
 
- 
isValidKeyFieldboolean isValidKeyField()- Returns:
- true if this type can participate in a primary key. Only atomic types can be part of a key. Among the atomic types, Boolean, Binary and FixedBinary are not allowed in keys.
 
- 
isValidIndexFieldboolean isValidIndexField()- Returns:
- true if this type can participate in an index. Only atomic types can be part of an index key. Among the atomic types, Boolean, Binary and FixedBinary are not allowed in index keys.
 
- 
isAnyboolean isAny()Returns true if this is anAnyDef.- Returns:
- true if this is an AnyDef, false otherwise
- Since:
- 4.0
 
- 
isAnyRecordboolean isAnyRecord()Returns true if this is anAnyRecordDef.- Returns:
- true if this is an AnyRecordDef, false otherwise
- Since:
- 4.0
 
- 
isAnyAtomicboolean isAnyAtomic()Returns true if this is anAnyAtomicDef.- Returns:
- true if this is an AnyAtomicDef, false otherwise
- Since:
- 4.0
 
- 
isNumberboolean isNumber()Returns true if this is aNumberDef.- Returns:
- true if this is a NumberDef, false otherwise
- Since:
- 4.4
 
- 
isAnyJsonAtomicboolean isAnyJsonAtomic()Returns true if this is anAnyJsonAtomicDef.- Returns:
- true if this is an AnyJsonAtomicDef, false otherwise
- Since:
- 4.3
 
- 
isBooleanboolean isBoolean()Returns true if this is aBooleanDef.- Returns:
- true if this is a BooleanDef, false otherwise
 
- 
isBinaryboolean isBinary()Returns true if this is aBinaryDef.- Returns:
- true if this is a BinaryDef, false otherwise
 
- 
isDoubleboolean isDouble()Returns true if this is aDoubleDef.- Returns:
- true if this is a DoubleDef, false otherwise
 
- 
isEnumboolean isEnum()Returns true if this is anEnumDef.- Returns:
- true if this is an EnumDef, false otherwise
 
- 
isFixedBinaryboolean isFixedBinary()Returns true if this is aFixedBinaryDef.- Returns:
- true if this is a FixedBinaryDef, false otherwise
 
- 
isFloatboolean isFloat()Returns true if this is aFloatDef.- Returns:
- true if this is a FloatDef, false otherwise
 
- 
isIntegerboolean isInteger()Returns true if this is anIntegerDef.- Returns:
- true if this is an IntegerDef, false otherwise
 
- 
isLongboolean isLong()Returns true if this is aLongDef.- Returns:
- true if this is a LongDef, false otherwise
 
- 
isStringboolean isString()Returns true if this is aStringDef.- Returns:
- true if this is a StringDef, false otherwise
 
- 
isUUIDStringboolean isUUIDString()Returns true if this is a STRING AS UUID type- Returns:
- true if this is a STRING AS UUID type, false otherwise
 
- 
isTimestampboolean isTimestamp()Returns true if this is aTimestampDef.- Returns:
- true if this is a TimestampDef, false otherwise
- Since:
- 4.3
 
- 
isArrayboolean isArray()Returns true if this is anArrayDef.- Returns:
- true if this is an ArrayDef, false otherwise
 
- 
isMapboolean isMap()Returns true if this is aMapDef.- Returns:
- true if this is a MapDef, false otherwise
 
- 
isRecordboolean isRecord()Returns true if this is aRecordDef.- Returns:
- true if this is a RecordDef, false otherwise
 
- 
isJsonboolean isJson()Returns true if this is a JSON type.- Returns:
- true if this is a JSON type, false otherwise
- Since:
- 4.2
 
- 
isAtomicboolean isAtomic()Returns true if this is an atomic type.- Returns:
- true if this is an atomic type, false otherwise
- Since:
- 4.0
 
- 
isNumericboolean isNumeric()Returns true if this is a numeric type.- Returns:
- true if this is a numeric type, false otherwise
- Since:
- 4.0
 
- 
isComplexboolean isComplex()Returns true if this is a complex type.- Returns:
- true if this is a complex type, false otherwise
- Since:
- 4.0
 
- 
isPreciseboolean isPrecise()- Since:
- 20.1
 
- 
isMRCounterdefault boolean isMRCounter()Returns true if this is a multi-region counter.- Returns:
- true if this is a multi-region counter, false otherwise.
- Since:
- 21.1
 
- 
asAnyAnyDef asAny()Casts to AnyDef.- Returns:
- an AnyDef
- Throws:
- ClassCastException- if this is not an AnyDef
- Since:
- 4.0
 
- 
asAnyRecordAnyRecordDef asAnyRecord()Casts to AnyRecordDef.- Returns:
- an AnyRecordDef
- Throws:
- ClassCastException- if this is not an AnyRecordDef
- Since:
- 4.0
 
- 
asAnyAtomicAnyAtomicDef asAnyAtomic()Casts to AnyAtomicDef.- Returns:
- an AnyAtomicDef
- Throws:
- ClassCastException- if this is not an AnyAtomicDef
- Since:
- 4.0
 
- 
asAnyJsonAtomicAnyJsonAtomicDef asAnyJsonAtomic()Casts to AnyJsonAtomicDef.- Returns:
- an AnyJsonAtomicDef
- Throws:
- ClassCastException- if this is not an AnyJsonAtomicDef
- Since:
- 4.3
 
- 
asBinaryBinaryDef asBinary()Casts to BinaryDef.- Returns:
- a BinaryDef
- Throws:
- ClassCastException- if this is not a BinaryDef
 
- 
asNumberNumberDef asNumber()Casts to NumberDef.- Returns:
- a NumberDef
- Throws:
- ClassCastException- if this is not a NumberDef
- Since:
- 4.4
 
- 
asBooleanBooleanDef asBoolean()Casts to BooleanDef.- Returns:
- a BooleanDef
- Throws:
- ClassCastException- if this is not a BooleanDef
 
- 
asDoubleDoubleDef asDouble()Casts to DoubleDef.- Returns:
- a DoubleDef
- Throws:
- ClassCastException- if this is not a DoubleDef
 
- 
asEnumEnumDef asEnum()Casts to EnumDef.- Returns:
- an EnumDef
- Throws:
- ClassCastException- if this is not an EnumDef
 
- 
asFixedBinaryFixedBinaryDef asFixedBinary()Casts to FixedBinaryDef.- Returns:
- a FixedBinaryDef
- Throws:
- ClassCastException- if this is not a FixedBinaryDef
 
- 
asFloatFloatDef asFloat()Casts to FloatDef.- Returns:
- a FloatDef
- Throws:
- ClassCastException- if this is not a FloatDef
 
- 
asIntegerIntegerDef asInteger()Casts to IntegerDef.- Returns:
- an IntegerDef
- Throws:
- ClassCastException- if this is not an IntegerDef
 
- 
asLongLongDef asLong()Casts to LongDef.- Returns:
- a LongDef
- Throws:
- ClassCastException- if this is not a LongDef
 
- 
asStringStringDef asString()Casts to StringDef.- Returns:
- a StringDef
- Throws:
- ClassCastException- if this is not a StringDef
 
- 
asTimestampTimestampDef asTimestamp()Casts to TimestampDef.- Returns:
- a TimestampDef
- Throws:
- ClassCastException- if this is not a TimestampDef
- Since:
- 4.3
 
- 
asArrayArrayDef asArray()Casts to ArrayDef.- Returns:
- an ArrayDef
- Throws:
- ClassCastException- if this is not an ArrayDef
 
- 
asMapMapDef asMap()Casts to MapDef.- Returns:
- a MapDef
- Throws:
- ClassCastException- if this is not a MapDef
 
- 
asRecordRecordDef asRecord()Casts to RecordDef.- Returns:
- a RecordDef
- Throws:
- ClassCastException- if this is not a RecordDef
 
- 
asJsonJsonDef asJson()Casts to JsonDef.- Returns:
- a JsonDef
- Throws:
- ClassCastException- if this is not a JsonDef
- Since:
- 4.2
 
- 
createArrayArrayValue createArray()Creates an empty ArrayValue.- Returns:
- an empty ArrayValue
- Throws:
- IllegalArgumentException- if this instance is not able to create an ArrayValue
 
- 
createNumberCreates a NumberValue instance based on the value- Parameters:
- value- the value to use
- Returns:
- a NumberValue
- Throws:
- IllegalArgumentException- if this instance is not able to create a NumberValue
- Since:
- 4.4
 
- 
createNumberCreates a NumberValue instance based on the value- Parameters:
- value- the value to use
- Returns:
- a NumberValue
- Throws:
- IllegalArgumentException- if this instance is not able to create a NumberValue
- Since:
- 4.4
 
- 
createNumberCreates a NumberValue instance based on the value- Parameters:
- value- the value to use
- Returns:
- a NumberValue
- Throws:
- IllegalArgumentException- if this instance is not able to create a NumberValue
- Since:
- 4.4
 
- 
createNumberCreates a NumberValue instance based on the value- Parameters:
- value- the value to use
- Returns:
- a NumberValue
- Throws:
- IllegalArgumentException- if this instance is not able to create a NumberValue
- Since:
- 4.4
 
- 
createNumberCreates a NumberValue instance based on the value- Parameters:
- value- a non-null BigDecimal value
- Returns:
- a NumberValue
- Throws:
- IllegalArgumentException- if this instance is not able to create a NumberValue
- Since:
- 4.4
 
- 
createBinaryCreates a BinaryValue instance based on the value.- Parameters:
- value- the byte array to use for the new value object. Must not be null.
- Returns:
- a BinaryValue
- Throws:
- IllegalArgumentException- if this instance is not able to create a BinaryValue or if the value is null
 
- 
createBooleanCreates a BooleanValue instance based on the value.- Parameters:
- value- the value to use
- Returns:
- a BooleanValue
- Throws:
- IllegalArgumentException- if this instance is not able to create a BooleanValue
 
- 
createDoubleCreates a DoubleValue instance based on the value.- Parameters:
- value- the value to use
- Returns:
- a DoubleValue
- Throws:
- IllegalArgumentException- if this instance is not able to create a DoubleValue
 
- 
createEnumCreates an EnumValue instance based on the value.- Parameters:
- value- the value to use
- Returns:
- a EnumValue
- Throws:
- IllegalArgumentException- if this instance is not able to create an EnumValue or if the value is not valid for the definition
 
- 
createFixedBinaryCreates a FixedBinaryValue instance based on the value.- Parameters:
- value- the value to use. It must not be null.
- Returns:
- a FixedBinaryValue
- Throws:
- IllegalArgumentException- if this instance is not able to create a FixedBinaryValue or if the value is null or not valid for the definition
 
- 
createFloatCreates a FloatValue instance based on the value.- Parameters:
- value- the value to use
- Returns:
- a FloatValue
- Throws:
- IllegalArgumentException- if this instance is not able to create a FloatValue
 
- 
createIntegerCreates an IntegerValue instance based on the value.- Parameters:
- value- the value to use
- Returns:
- a IntegerValue
- Throws:
- IllegalArgumentException- if this instance is not able to create an IntegerValue or if the value is not valid for the definition
 
- 
createLongCreates a LongValue instance based on the value.- Parameters:
- value- the value to use
- Returns:
- a LongValue
- Throws:
- IllegalArgumentException- if this instance is not able to create a LongValue
 
- 
createTimestampCreates a TimestampValue instance based on the value.- Parameters:
- value- the value to use
- Returns:
- a TimestampValue
- Throws:
- IllegalArgumentException- if this instance is not able to create a TimestampValue
- Since:
- 4.3
 
- 
createMapMapValue createMap()Creates an empty MapValue.- Returns:
- an empty MapValue
- Throws:
- IllegalArgumentException- if this instance is not able to create a MapValue
 
- 
createRecordRecordValue createRecord()Creates an empty RecordValue.- Returns:
- an empty RecordValue
- Throws:
- IllegalArgumentException- if this instance is not able to create a RecordValue
 
- 
createStringCreates a StringValue instance based on the value.- Parameters:
- value- the value to use
- Returns:
- a StringValue
- Throws:
- IllegalArgumentException- if this instance is not able to create a StringValue
 
- 
createJsonNullFieldValue createJsonNull()Creates a special FieldValue instance representing a JSON null. This value returns true forFieldValue.isJsonNull().- Returns:
- a FieldValue
- Throws:
- IllegalArgumentException- if this instance is not able to create a JSON null (is not of type JSON)
- Since:
- 4.3
 
 
-