Package io.permazen.core
Class CollectionField<C extends Collection<E>,E>
java.lang.Object
io.permazen.core.SchemaItem
io.permazen.core.Field<T>
io.permazen.core.ComplexField<C>
io.permazen.core.CollectionField<C,E>
- Type Parameters:
C
- Java collection typeE
- Java collection element type
Superclass of fields with types assignable to
Collection
.-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet the element field.Get the index on this fields's "element" sub-field.final List<SimpleField<E>>
Get the sub-field(s) associated with this instance, ordered according to their meaning.abstract C
getValue
(Transaction tx, ObjId id) Get the value of this field in the given object.boolean
hasDefaultValue
(Transaction tx, ObjId id) Determine if this field in the specified object has its default value in the specifiedTransaction
.Methods inherited from class io.permazen.core.Field
getFullName, getKey, getObjType, getTypeToken, visit
Methods inherited from class io.permazen.core.SchemaItem
getName, getSchema, getSchemaId, getStorageId, toString
-
Field Details
-
ELEMENT_FIELD_NAME
- See Also:
-
-
Method Details
-
getElementField
Get the element field.- Returns:
- collection element field
-
getElementIndex
Get the index on this fields's "element" sub-field.- Returns:
- the index on this field's "element" sub-field
- Throws:
UnknownIndexException
- if there is no index on the "element" 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<C extends Collection<E>>
- Returns:
- unmodifiable list of simple fields
-
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<C extends Collection<E>>
- 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
-
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<C extends Collection<E>>
- Parameters:
tx
- transactionid
- object id- Returns:
- this field's value in the specified object
-