public interface MapFieldChangeListener
MapField
.Transaction.addMapFieldChangeListener()
Modifier and Type | Method and Description |
---|---|
<K,V> void |
onMapFieldAdd(Transaction tx,
ObjId id,
MapField<K,V> field,
int[] path,
NavigableSet<ObjId> referrers,
K key,
V value)
Receive notification of the addition of a new key/value pair into a
MapField . |
void |
onMapFieldClear(Transaction tx,
ObjId id,
MapField<?,?> field,
int[] path,
NavigableSet<ObjId> referrers)
Receive notification of the clearing of a
MapField . |
<K,V> void |
onMapFieldRemove(Transaction tx,
ObjId id,
MapField<K,V> field,
int[] path,
NavigableSet<ObjId> referrers,
K key,
V value)
Receive notification of the removal of an entry from a
MapField . |
<K,V> void |
onMapFieldReplace(Transaction tx,
ObjId id,
MapField<K,V> field,
int[] path,
NavigableSet<ObjId> referrers,
K key,
V oldValue,
V newValue)
Receive notification of the change in value of an existing entry in a
MapField . |
<K,V> void onMapFieldAdd(Transaction tx, ObjId id, MapField<K,V> field, int[] path, NavigableSet<ObjId> referrers, K key, V value)
MapField
.
Notifications are only delivered when the set of referring objects is non-empty.
Notifications are delivered in the same thread that made the change, before the outermost mutation operation returns.
K
- Java type for field
's keysV
- Java type for field
's valuestx
- associated transactionid
- the ID of the affected object (i.e., the object containing the field that changed)field
- the field that changedpath
- path of reference fields (represented by storage IDs) that lead to id
referrers
- all objects that (indirectly) refer to the affected object via path
key
- the new map entry's keyvalue
- the new map entry's value<K,V> void onMapFieldRemove(Transaction tx, ObjId id, MapField<K,V> field, int[] path, NavigableSet<ObjId> referrers, K key, V value)
MapField
.
Notifications are only delivered when the set of referring objects is non-empty.
Notifications are delivered in the same thread that made the change, before the outermost mutation operation returns.
K
- Java type for field
's keysV
- Java type for field
's valuestx
- associated transactionid
- the ID of the affected object (i.e., the object containing the field that changed)field
- the field that changedpath
- path of reference fields (represented by storage IDs) that lead to id
referrers
- all objects that (indirectly) refer to the affected object via path
key
- the removed map entry's keyvalue
- the removed map entry's value<K,V> void onMapFieldReplace(Transaction tx, ObjId id, MapField<K,V> field, int[] path, NavigableSet<ObjId> referrers, K key, V oldValue, V newValue)
MapField
.
Notifications are only delivered when the set of referring objects is non-empty.
Notifications are delivered in the same thread that made the change, before the outermost mutation operation returns.
K
- Java type for field
's keysV
- Java type for field
's valuestx
- associated transactionid
- the ID of the affected object (i.e., the object containing the field that changed)field
- the field that changedpath
- path of reference fields (represented by storage IDs) that lead to id
referrers
- all objects that (indirectly) refer to the affected object via path
key
- the map entry keyoldValue
- the previous value associated with key
newValue
- the new value associated with key
void onMapFieldClear(Transaction tx, ObjId id, MapField<?,?> field, int[] path, NavigableSet<ObjId> referrers)
MapField
.
This method is only used when the whole map is cleared; when a range restricted submap is cleared, individual onMapFieldRemove() invocations for each removed entry are made instead.
Notifications are only delivered when the set of referring objects is non-empty.
Notifications are delivered in the same thread that made the change, before the outermost mutation operation returns.
tx
- associated transactionid
- the ID of the affected object (i.e., the object containing the field that was cleared)field
- the field that changedpath
- path of reference fields (represented by storage IDs) that lead to id
referrers
- all objects that (indirectly) refer to the affected object via path
Copyright © 2022. All rights reserved.