Package com.yahoo.document.datatypes
Class FieldValue
java.lang.Object
com.yahoo.vespa.objects.Selectable
com.yahoo.vespa.objects.Identifiable
com.yahoo.document.datatypes.FieldValue
- All Implemented Interfaces:
Cloneable
,Comparable<FieldValue>
- Direct Known Subclasses:
AnnotationReference
,BoolFieldValue
,CompositeFieldValue
,NumericFieldValue
,PredicateFieldValue
,Raw
,ReferenceFieldValue
,StringFieldValue
,TensorFieldValue
public abstract class FieldValue
extends com.yahoo.vespa.objects.Identifiable
implements Comparable<FieldValue>
- Author:
- Einar M R Rosenvinge
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
Assign this non-fieldvalue value to this field value.abstract void
clear()
clone()
int
compareTo
(FieldValue fieldValue) static FieldValue
create
(FieldReader reader, DataType type) abstract void
deserialize
(Field field, FieldReader reader) Read a field value from the specified readerfinal void
deserialize
(FieldReader reader) Read data from the given buffer to create this field value.abstract DataType
getRecursiveValue
(FieldPath path) getRecursiveValue
(String path) Using the given field path, digs through the document and returns the matching field value.Used to retrieve wrapped type for simple types, such that you can use get methods to retrieve ints and floats directly instead of Int/Float field values.void
onDeserialize
(com.yahoo.vespa.objects.Deserializer data) void
onSerialize
(com.yahoo.vespa.objects.Serializer target) abstract void
Deprecated.abstract void
serialize
(Field field, FieldWriter writer) Write out field value to the specified writerfinal void
serialize
(com.yahoo.io.GrowableByteBuffer buf) toXml()
Deprecated.Methods inherited from class com.yahoo.vespa.objects.Identifiable
create, createFromId, deserialize, deserializeOptional, deserializeWithId, equals, equals, getClassId, getRawUtf8Bytes, getUtf8, hashCode, onGetClassId, putUtf8, registerClass, registerClass, serialize, serializeOptional, serializeWithId, toString, visitMembers
Methods inherited from class com.yahoo.vespa.objects.Selectable
select, select, selectMembers
-
Field Details
-
classId
public static final int classId
-
-
Constructor Details
-
FieldValue
public FieldValue()
-
-
Method Details
-
getDataType
-
create
-
toXml
Deprecated.Get XML representation of a single field and all its children, if any.- Returns:
- XML representation of field in a <value> element
-
deserialize
Read data from the given buffer to create this field value. As some field values have their type self contained, we need the type manager object to be able to retrieve it. -
serialize
public final void serialize(com.yahoo.io.GrowableByteBuffer buf) -
printXml
Deprecated. -
clear
public abstract void clear() -
clone
- Overrides:
clone
in classcom.yahoo.vespa.objects.Identifiable
-
assign
Assign 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.
- Throws:
IllegalArgumentException
- If the object given is of wrong type for this field value.
-
getWrappedValue
Used to retrieve wrapped type for simple types, such that you can use get methods to retrieve ints and floats directly instead of Int/Float field values. Complex types that can't be specified by simple java types just return themselves. -
getRecursiveValue
Using the given field path, digs through the document and returns the matching field value. If the field path resolves to multiple values, returns an ArrayFieldValue containing the values. -
getRecursiveValue
-
onSerialize
public void onSerialize(com.yahoo.vespa.objects.Serializer target) - Overrides:
onSerialize
in classcom.yahoo.vespa.objects.Identifiable
-
onDeserialize
public void onDeserialize(com.yahoo.vespa.objects.Deserializer data) - Overrides:
onDeserialize
in classcom.yahoo.vespa.objects.Identifiable
-
serialize
Write out field value to the specified writer -
deserialize
Read a field value from the specified reader -
compareTo
- Specified by:
compareTo
in interfaceComparable<FieldValue>
-