Package com.yahoo.document
Class MapDataType
- java.lang.Object
-
- com.yahoo.vespa.objects.Selectable
-
- com.yahoo.vespa.objects.Identifiable
-
- com.yahoo.document.DataType
-
- com.yahoo.document.MapDataType
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.lang.Comparable<DataType>
public class MapDataType extends DataType
Represents a map type.- Author:
- vegardh
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description MapDataType(DataType keyType, DataType valueType)
MapDataType(DataType keyType, DataType valueType, int id)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description FieldPath
buildFieldPath(java.lang.String remainFieldName)
Creates a field path from the given field path string.static FieldPath
buildFieldPath(java.lang.String remainFieldName, DataType keyType, DataType valueType)
MapDataType
clone()
protected FieldValue
createByReflection(java.lang.Object arg)
Creates a field value by reflectionMapFieldValue
createFieldValue()
Creates a new, empty FieldValue of this typeDataType
getKeyType()
java.lang.Class
getValueClass()
DataType
getValueType()
boolean
isMultivalue()
Returns whether this is a multivalue type, i.e either a CollectionDataType or a MapDataTypeboolean
isValueCompatible(FieldValue value)
protected void
register(DocumentTypeManager manager, java.util.List<DataType> seenTypes)
void
setKeyType(DataType keyType)
Sets the key type of this MapDataType. WARNING! Do not use! Only to be used by config system!void
setValueType(DataType valueType)
Sets the key type of this MapDataType. WARNING! Do not use! Only to be used by config system!-
Methods inherited from class com.yahoo.document.DataType
compareTo, createFieldValue, equals, getArray, getCode, getId, getMap, getName, getPrimitiveType, getTensor, getWeightedSet, getWeightedSet, hashCode, isAssignableFrom, isRegistered, lastPredefinedDataTypeId, register, setId, setName, toString, visitMembers
-
-
-
-
Method Detail
-
clone
public MapDataType clone()
-
createByReflection
protected FieldValue createByReflection(java.lang.Object arg)
Description copied from class:DataType
Creates a field value by reflection- Overrides:
createByReflection
in classDataType
- Parameters:
arg
- the value of the newly created field value- Returns:
- a fully constructed value
-
isValueCompatible
public boolean isValueCompatible(FieldValue value)
- Specified by:
isValueCompatible
in classDataType
-
getKeyType
public DataType getKeyType()
-
getValueType
public DataType getValueType()
-
setKeyType
public void setKeyType(DataType keyType)
Sets the key type of this MapDataType. WARNING! Do not use! Only to be used by config system!
-
setValueType
public void setValueType(DataType valueType)
Sets the key type of this MapDataType. WARNING! Do not use! Only to be used by config system!
-
createFieldValue
public MapFieldValue createFieldValue()
Description copied from class:DataType
Creates a new, empty FieldValue of this type- Specified by:
createFieldValue
in classDataType
-
getValueClass
public java.lang.Class getValueClass()
- Specified by:
getValueClass
in classDataType
-
register
protected void register(DocumentTypeManager manager, java.util.List<DataType> seenTypes)
-
buildFieldPath
public static FieldPath buildFieldPath(java.lang.String remainFieldName, DataType keyType, DataType valueType)
-
buildFieldPath
public FieldPath buildFieldPath(java.lang.String remainFieldName)
Description copied from class:DataType
Creates a field path from the given field path string.- Overrides:
buildFieldPath
in classDataType
- Parameters:
remainFieldName
- a string containing the field path- Returns:
- Returns a valid field path, parsed from the string
-
isMultivalue
public boolean isMultivalue()
Description copied from class:DataType
Returns whether this is a multivalue type, i.e either a CollectionDataType or a MapDataType- Overrides:
isMultivalue
in classDataType
-
-