Package io.permazen.core
Class CounterField
Counter fields.
Counter fields have long
values and can be adjusted concurrently by multiple transactions,
typically without locking (depending on the underlying key/value store).
Counter fields do not support indexing or change listeners.
Note: during @OnSchemaChange
notifications, counter field
values appear as Long
s.
-
Method Summary
Modifier and TypeMethodDescriptiongetValue
(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
.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
-
Method Details
-
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<Long>
- 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
-