Package com.yahoo.document
Class StructDataType
- java.lang.Object
-
- com.yahoo.vespa.objects.Selectable
-
- com.yahoo.vespa.objects.Identifiable
-
- com.yahoo.document.DataType
-
- com.yahoo.document.StructuredDataType
-
- com.yahoo.document.BaseStructDataType
-
- com.yahoo.document.StructDataType
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.lang.Comparable<DataType>
- Direct Known Subclasses:
TemporaryStructuredDataType
public class StructDataType extends BaseStructDataType
- Author:
- Einar M R Rosenvinge
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static int
classId
-
Fields inherited from class com.yahoo.document.BaseStructDataType
compressor, fieldIds, fields
-
-
Constructor Summary
Constructors Constructor Description StructDataType(int id, java.lang.String name)
StructDataType(java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addField(Field field)
void
assign(StructDataType type)
StructDataType
clone()
Struct
createFieldValue()
Creates a new, empty FieldValue of this typeFieldValue
createFieldValue(java.lang.Object o)
Creates a new FieldValue of this type, with the given value.boolean
equals(java.lang.Object o)
Field
getField(int id)
Gets the field with the specified id.Field
getField(java.lang.String fieldName)
Gets the field matching a given name.int
getFieldCount()
java.util.Collection<Field>
getFields()
java.util.Collection<Field>
getFieldsThisTypeOnly()
java.util.Collection<StructDataType>
getInheritedTypes()
java.lang.Class
getValueClass()
int
hashCode()
void
inherit(StructDataType type)
boolean
inherits(StructDataType type)
boolean
isValueCompatible(FieldValue value)
-
Methods inherited from class com.yahoo.document.BaseStructDataType
assign, clearFields, getCompressionConfig, getCompressor, hasField, hasField, removeField, setCompressionConfig
-
Methods inherited from class com.yahoo.document.StructuredDataType
buildFieldPath, createByReflection, createId, getDataTypeName, register
-
Methods inherited from class com.yahoo.document.DataType
compareTo, getArray, getCode, getId, getMap, getName, getPrimitiveType, getTensor, getWeightedSet, getWeightedSet, isAssignableFrom, isMultivalue, isRegistered, lastPredefinedDataTypeId, register, setId, setName, toString, visitMembers
-
-
-
-
Method Detail
-
createFieldValue
public Struct createFieldValue()
Description copied from class:DataType
Creates a new, empty FieldValue of this type- Specified by:
createFieldValue
in classStructuredDataType
-
createFieldValue
public FieldValue createFieldValue(java.lang.Object o)
Description copied from class:DataType
Creates a new FieldValue of this type, with the given value.- Overrides:
createFieldValue
in classDataType
- Parameters:
o
- the value of the new FieldValue- Returns:
- a new FieldValue of this type, with the given value
-
clone
public StructDataType clone()
- Overrides:
clone
in classBaseStructDataType
-
assign
public void assign(StructDataType type)
-
getField
public Field getField(java.lang.String fieldName)
Description copied from class:StructuredDataType
Gets the field matching a given name.- Overrides:
getField
in classBaseStructDataType
- Parameters:
fieldName
- The name of a field.- Returns:
- Returns the matching field, or null if not found.
-
getField
public Field getField(int id)
Description copied from class:StructuredDataType
Gets the field with the specified id.- Overrides:
getField
in classBaseStructDataType
- Parameters:
id
- the id of the field to return.- Returns:
- the matching field, or null if not found.
-
addField
public void addField(Field field)
- Overrides:
addField
in classBaseStructDataType
-
getFields
public java.util.Collection<Field> getFields()
- Overrides:
getFields
in classBaseStructDataType
-
getFieldsThisTypeOnly
public java.util.Collection<Field> getFieldsThisTypeOnly()
-
getFieldCount
public int getFieldCount()
- Overrides:
getFieldCount
in classBaseStructDataType
-
getValueClass
public java.lang.Class getValueClass()
- Specified by:
getValueClass
in classDataType
-
isValueCompatible
public boolean isValueCompatible(FieldValue value)
- Specified by:
isValueCompatible
in classDataType
-
inherit
public void inherit(StructDataType type)
-
getInheritedTypes
public java.util.Collection<StructDataType> getInheritedTypes()
-
inherits
public boolean inherits(StructDataType type)
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classStructuredDataType
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classStructuredDataType
-
-