Package io.permazen.core
Class MapField<K,V>
- Type Parameters:
K
- Map key typeV
- Map value type
Map field.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]
Get thebyte[]
key in the underlying key/value store corresponding to this field in the specified object and the specified map key.Get the key field.Get the index on this fields's "key" sub-field.Get the index on this fields's "value" sub-field.List<SimpleField<?>>
Get the sub-field(s) associated with this instance, ordered according to their meaning.getValue
(Transaction tx, ObjId id) Get the value of this field in the given object.Get the value field.boolean
hasDefaultValue
(Transaction tx, ObjId id) Determine if this field in the specified object has its default value in the specifiedTransaction
.toString()
<R> R
visit
(FieldSwitch<R> target) Apply visitor pattern.Methods inherited from class io.permazen.core.Field
getFullName, getKey, getObjType, getTypeToken
Methods inherited from class io.permazen.core.SchemaItem
getName, getSchema, getSchemaId, getStorageId
-
Field Details
-
KEY_FIELD_NAME
- See Also:
-
VALUE_FIELD_NAME
- See Also:
-
-
Method Details
-
getKeyField
Get the key field.- Returns:
- map key field
-
getValueField
Get the value field.- Returns:
- map value field
-
getMapKeyIndex
Get the index on this fields's "key" sub-field.- Returns:
- the index on this field's "key" sub-field
- Throws:
UnknownIndexException
- if there is no index on the "key" sub-field
-
getMapValueIndex
Get the index on this fields's "value" sub-field.- Returns:
- the index on this field's "value" sub-field
- Throws:
UnknownIndexException
- if there is no index on the "value" sub-field
-
getSubFields
Description copied from class:ComplexField
Get the sub-field(s) associated with this instance, ordered according to their meaning.- Specified by:
getSubFields
in classComplexField<NavigableMap<K,
V>> - Returns:
- unmodifiable list of simple fields
-
getValue
Description copied from class:Field
Get the value of this field in the given object. Does not alter the schema of the object.- Specified by:
getValue
in classField<NavigableMap<K,
V>> - Parameters:
tx
- transactionid
- object id- Returns:
- this field's value in the specified object
-
getKey
Get thebyte[]
key in the underlying key/value store corresponding to this field in the specified object and the specified map key.- Parameters:
id
- object IDkey
- map key- Returns:
- the corresponding
KVDatabase
key - Throws:
IllegalArgumentException
- ifid
is null or has the wrong object type- See Also:
-
hasDefaultValue
Description copied from class:Field
Determine if this field in the specified object has its default value in the specifiedTransaction
.- Specified by:
hasDefaultValue
in classField<NavigableMap<K,
V>> - Parameters:
tx
-Transaction
containing field stateid
- object ID- Returns:
- true if this field is set to its initial default value in object
id
, otherwise false
-
toString
- Specified by:
toString
in classSchemaItem
-
visit
Description copied from class:Field
Apply visitor pattern.- Specified by:
visit
in classField<NavigableMap<K,
V>> - Type Parameters:
R
- visitor return type- Parameters:
target
- target to invoke- Returns:
- return value from the method of
target
corresponding to this instance's type
-