Package com.yahoo.document.annotation
Class AnnotationReference
java.lang.Object
com.yahoo.vespa.objects.Selectable
com.yahoo.vespa.objects.Identifiable
com.yahoo.document.datatypes.FieldValue
com.yahoo.document.annotation.AnnotationReference
- All Implemented Interfaces:
Cloneable,Comparable<FieldValue>
A FieldValue which holds a reference to an annotation of a specified type.
- Author:
- Einar M R Rosenvinge
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new AnnotationReference.AnnotationReference(AnnotationReferenceDataType type, Annotation reference) Constructs a new AnnotationReference, with a reference to the givenAnnotation. -
Method Summary
Modifier and TypeMethodDescriptionvoidAssign this non-fieldvalue value to this field value.voidclear()clone()Clones this AnnotationReference. Note: No deep-copying, so the AnnotationReference returned refers to the same Annotation as this AnnotationReference.intcompareTo(FieldValue fieldValue) voiddeserialize(Field field, FieldReader reader) Read a field value from the specified readerbooleanReturns the Annotation that this AnnotationReference refers to.inthashCode()voidDeprecated.voidserialize(Field field, FieldWriter writer) Write out field value to the specified writervoidsetDataType(DataType dataType) voidsetReference(Annotation reference) Set anAnnotationthat this AnnotationReference shall refer to.voidsetReferenceNoCompatibilityCheck(Annotation reference) WARNING!toString()Methods inherited from class com.yahoo.document.datatypes.FieldValue
create, deserialize, getRecursiveValue, getRecursiveValue, getWrappedValue, onDeserialize, onSerialize, serialize, toXmlMethods inherited from class com.yahoo.vespa.objects.Identifiable
create, createFromId, deserialize, deserializeOptional, deserializeWithId, equals, getClassId, getRawUtf8Bytes, getUtf8, onGetClassId, putUtf8, registerClass, registerClass, serialize, serializeOptional, serializeWithId, visitMembersMethods inherited from class com.yahoo.vespa.objects.Selectable
select, select, selectMembers
-
Field Details
-
classId
public static int classId
-
-
Constructor Details
-
AnnotationReference
Constructs a new AnnotationReference, with a reference to the givenAnnotation.- Parameters:
type- the data type of this AnnotationReferencereference- the reference to set- Throws:
IllegalArgumentException- if the given annotation has a type that is not compatible with this reference
-
AnnotationReference
Constructs a new AnnotationReference.- Parameters:
type- the data type of this AnnotationReference
-
-
Method Details
-
clone
Clones this AnnotationReference. Note: No deep-copying, so the AnnotationReference returned refers to the same Annotation as this AnnotationReference.- Overrides:
clonein classFieldValue- Returns:
- a copy of this object, referring to the same Annotation instance.
-
getReference
Returns the Annotation that this AnnotationReference refers to.- Returns:
- the Annotation that this AnnotationReference refers to.
-
assign
Description copied from class:FieldValueAssign this non-fieldvalue value to this field value. This is used to be able to assign ints to Integer field values and List to Array field values and such.Override to accept the specific types that should be legal.
- Specified by:
assignin classFieldValue
-
setReference
Set anAnnotationthat this AnnotationReference shall refer to.- Parameters:
reference- an Annotation that this AnnotationReference shall refer to.- Throws:
IllegalArgumentException- if the given annotation has a type that is not compatible with this reference
-
setReferenceNoCompatibilityCheck
WARNING! Only to be used by deserializers when reference is not fully deserialized yet! Sets anAnnotationthat this AnnotationReference shall refer to.- Parameters:
reference- an Annotation that this AnnotationReference shall refer to.- Throws:
IllegalArgumentException- if the given annotation has a type that is not compatible with this reference
-
getDataType
- Specified by:
getDataTypein classFieldValue
-
setDataType
-
printXml
Deprecated.- Specified by:
printXmlin classFieldValue
-
clear
public void clear()- Specified by:
clearin classFieldValue
-
serialize
Description copied from class:FieldValueWrite out field value to the specified writer- Specified by:
serializein classFieldValue
-
deserialize
Description copied from class:FieldValueRead a field value from the specified reader- Specified by:
deserializein classFieldValue
-
equals
- Overrides:
equalsin classcom.yahoo.vespa.objects.Identifiable
-
hashCode
public int hashCode()- Overrides:
hashCodein classcom.yahoo.vespa.objects.Identifiable
-
toString
- Overrides:
toStringin classcom.yahoo.vespa.objects.Identifiable
-
compareTo
- Specified by:
compareToin interfaceComparable<FieldValue>- Overrides:
compareToin classFieldValue
-