Package io.permazen.core
Class SimpleField<T>
java.lang.Object
io.permazen.core.SchemaItem
io.permazen.core.Field<T>
io.permazen.core.SimpleField<T>
- Type Parameters:
T
- Java type for the field's values
- Direct Known Subclasses:
EnumArrayField
,EnumField
,ReferenceField
-
Method Summary
Modifier and TypeMethodDescriptionGet theCompositeIndex
s that contain this field, if any.Get theEncoding
associated with this field.Get the full name of this field.getIndex()
Get theSimpleIndex
on this field.ComplexField<?>
Get the parent field if this field is a sub-field of a complex field.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
.boolean
Determine whether this field is indexed.protected T
remapObjectId
(ObjIdMap<ObjId> objectIdMap, T value) protected boolean
void
setValue
(Transaction tx, ObjId id, T value) Set the value of this field in the given object.toString()
<R> R
visit
(FieldSwitch<R> target) Apply visitor pattern.Methods inherited from class io.permazen.core.Field
getKey, getObjType, getTypeToken
Methods inherited from class io.permazen.core.SchemaItem
getName, getSchema, getSchemaId, getStorageId
-
Method Details
-
getEncoding
Get theEncoding
associated with this field.- Returns:
- this field's type
-
isIndexed
public boolean isIndexed()Determine whether this field is indexed.- Returns:
- true if this field is indexed
-
getParentField
Get the parent field if this field is a sub-field of a complex field.- Returns:
- parent field, or null if this is not a sub-field
-
getFullName
Description copied from class:Field
Get the full name of this field.If the field is a sub-field of a complex field, the full name is the field's name qualified by the parent field name, e.g.,
"mymap.key"
. Otherwise, the full is is the same as the name.- Overrides:
getFullName
in classField<T>
- Returns:
- this field's full name
-
getIndex
Get theSimpleIndex
on this field.- Returns:
- the index on this field
- Throws:
UnknownIndexException
- if there is no simple index on this field
-
getCompositeIndexes
Get theCompositeIndex
s that contain this field, if any.- Returns:
- zero or more
CompositeIndex
that contain this field
-
setValue
Set the value of this field in the given object. Does not alter the schema of the object.- Parameters:
tx
- transactionid
- object idvalue
- new value- Throws:
DeletedObjectException
- if no object with ID equal toid
is foundStaleTransactionException
- if this transaction is no longer usableIllegalArgumentException
- iftx
orid
is nullIllegalArgumentException
- if this field is a sub-field of aComplexField
-
getValue
Description copied from class:Field
Get the value of this field in the given object. Does not alter the schema of the object. -
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<T>
- 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
-
visit
Description copied from class:Field
Apply visitor pattern. -
toString
- Specified by:
toString
in classSchemaItem
-
remapsObjectId
protected boolean remapsObjectId() -
remapObjectId
-