Interface MapFieldChangeListener


public interface MapFieldChangeListener
Listener interface for notifications of a change in value of a MapField.
See Also:
  • Method Details

    • onMapFieldAdd

      <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.

      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.

      Type Parameters:
      K - Java type for field's keys
      V - Java type for field's values
      Parameters:
      tx - associated transaction
      id - the ID of the affected object (i.e., the object containing the field that changed)
      field - the field that changed
      path - 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 key
      value - the new map entry's value
    • onMapFieldRemove

      <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.

      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.

      Type Parameters:
      K - Java type for field's keys
      V - Java type for field's values
      Parameters:
      tx - associated transaction
      id - the ID of the affected object (i.e., the object containing the field that changed)
      field - the field that changed
      path - 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 key
      value - the removed map entry's value
    • onMapFieldReplace

      <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.

      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.

      Type Parameters:
      K - Java type for field's keys
      V - Java type for field's values
      Parameters:
      tx - associated transaction
      id - the ID of the affected object (i.e., the object containing the field that changed)
      field - the field that changed
      path - 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 key
      oldValue - the previous value associated with key
      newValue - the new value associated with key
    • onMapFieldClear

      void onMapFieldClear(Transaction tx, ObjId id, MapField<?,?> field, int[] path, NavigableSet<ObjId> referrers)
      Receive notification of the clearing of a 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.

      Parameters:
      tx - associated transaction
      id - the ID of the affected object (i.e., the object containing the field that was cleared)
      field - the field that changed
      path - path of reference fields (represented by storage IDs) that lead to id
      referrers - all objects that (indirectly) refer to the affected object via path