Package com.yahoo.document
Class ReferenceDataType
java.lang.Object
com.yahoo.vespa.objects.Selectable
com.yahoo.vespa.objects.Identifiable
com.yahoo.document.DataType
com.yahoo.document.ReferenceDataType
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable<DataType>
A
ReferenceDataType
specifies a particular concrete document type that a
ReferenceFieldValue
instance binds to.- Author:
- vekterli
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionReferenceDataType
(DocumentType targetType, int id) ReferenceDataType
(TemporaryStructuredDataType temporaryTargetType, int id) Constructor used when building a multi document type model where the concrete instance of the target document type might not yet be known. -
Method Summary
Modifier and TypeMethodDescriptionint
Creates a new, empty FieldValue of this typestatic ReferenceDataType
createWithInferredId
(DocumentType targetType) Creates a new type where the numeric ID is based on the hash of targetTypestatic ReferenceDataType
createWithInferredId
(TemporaryStructuredDataType targetType) Creates a new type where the numeric ID is based on the hash of targetTypeboolean
Class<? extends ReferenceFieldValue>
boolean
isValueCompatible
(FieldValue value) void
setTargetType
(StructuredDataType targetType) Overrides the stored temporary data type with a concrete StructuredDataType instance.Methods inherited from class com.yahoo.document.DataType
buildFieldPath, clone, createByReflection, createFieldValue, getArray, getCode, getId, getMap, getName, getPrimitiveType, getTensor, getWeightedSet, getWeightedSet, hashCode, isAssignableFrom, isMultivalue, isRegistered, lastPredefinedDataTypeId, register, register, setId, setName, toString, visitMembers
Methods inherited from class com.yahoo.vespa.objects.Identifiable
create, createFromId, deserialize, deserializeOptional, deserializeWithId, equals, getClassId, getRawUtf8Bytes, getUtf8, onDeserialize, onGetClassId, onSerialize, putUtf8, registerClass, serialize, serializeOptional, serializeWithId
Methods inherited from class com.yahoo.vespa.objects.Selectable
select, select, selectMembers
-
Field Details
-
classId
public static final int classId
-
-
Constructor Details
-
ReferenceDataType
-
ReferenceDataType
Constructor used when building a multi document type model where the concrete instance of the target document type might not yet be known. The temporary data type should be replaced later using setTargetType().
-
-
Method Details
-
createWithInferredId
Creates a new type where the numeric ID is based on the hash of targetType -
createWithInferredId
Creates a new type where the numeric ID is based on the hash of targetType -
getTargetType
-
setTargetType
Overrides the stored temporary data type with a concrete StructuredDataType instance. Should only be invoked from configuration or model code when resolving temporary types.- Throws:
IllegalStateException
- if the previously stored target type is already a concrete instance (not TemporaryStructuredDataType).
-
createFieldValue
Description copied from class:DataType
Creates a new, empty FieldValue of this type- Specified by:
createFieldValue
in classDataType
-
getValueClass
- Specified by:
getValueClass
in classDataType
-
isValueCompatible
- Specified by:
isValueCompatible
in classDataType
-
compareTo
- Specified by:
compareTo
in interfaceComparable<DataType>
- Overrides:
compareTo
in classDataType
-
equals
-