Package io.permazen.change
Class MapFieldReplace<T,K,V>
java.lang.Object
io.permazen.change.Change<T>
io.permazen.change.FieldChange<T>
io.permazen.change.MapFieldChange<T>
io.permazen.change.MapFieldReplace<T,K,V>
- Type Parameters:
T
- the type of the object containing the changed fieldK
- the type of the changed map's keyV
- the type of the changed map's value
Notification object that gets passed to
@OnChange
-annotated methods
when the value in a key/value pair is replaced with a new value.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
apply
(PermazenTransaction jtx, PermazenObject jobj) Apply this change to the given object in the given transaction.boolean
getKey()
Get the key of the key/value pair whose value was replaced.Get the value of the key/value pair after the change.Get the value of the key/value pair before the change.int
hashCode()
toString()
<R> R
visit
(ChangeSwitch<R> target) Apply visitor pattern.Methods inherited from class io.permazen.change.FieldChange
getFieldName
-
Constructor Details
-
MapFieldReplace
Constructor.- Parameters:
jobj
- Java object containing the map field that changedfieldName
- the name of the field that changedkey
- the key whose value was changedoldValue
- the old value associated withkey
newValue
- the new value associated withkey
- Throws:
IllegalArgumentException
- ifjobj
orfieldName
is null
-
-
Method Details
-
visit
Description copied from class:Change
Apply visitor pattern. Invokes the method oftarget
corresponding to this instance's type. -
apply
Description copied from class:Change
Apply this change to the given object in the given transaction. -
getKey
Get the key of the key/value pair whose value was replaced.- Returns:
- the key of the replaced value
-
getOldValue
Get the value of the key/value pair before the change.- Returns:
- the replaced value
-
getNewValue
Get the value of the key/value pair after the change.- Returns:
- the replacing value
-
equals
- Overrides:
equals
in classFieldChange<T>
-
hashCode
public int hashCode()- Overrides:
hashCode
in classFieldChange<T>
-
toString
-