Package io.permazen.change
Class MapFieldAdd<T,K,V>
java.lang.Object
io.permazen.change.Change<T>
io.permazen.change.FieldChange<T>
io.permazen.change.MapFieldChange<T>
io.permazen.change.MapFieldAdd<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 a new key/value pair is added to a map field.-
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 new key/value pair that was added.getValue()
Get the value of the new key/value pair that was added.int
hashCode()
toString()
<R> R
visit
(ChangeSwitch<R> target) Apply visitor pattern.Methods inherited from class io.permazen.change.FieldChange
getFieldName
-
Constructor Details
-
MapFieldAdd
Constructor.- Parameters:
jobj
- Java object containing the map field that changedfieldName
- the name of the field that changedkey
- the key of the new key/value pairvalue
- the value of the new key/value pair- 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 new key/value pair that was added.- Returns:
- the key of the newly added key/value pair
-
getValue
Get the value of the new key/value pair that was added.- Returns:
- the value of the newly added key/value pair
-
equals
- Overrides:
equals
in classFieldChange<T>
-
hashCode
public int hashCode()- Overrides:
hashCode
in classFieldChange<T>
-
toString
-