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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(PermazenTransaction jtx, PermazenObject jobj) Apply this change to the given object in the given transaction.booleangetKey()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.inthashCode()toString()<R> Rvisit(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- ifjobjorfieldNameis null
-
-
Method Details
-
visit
Description copied from class:ChangeApply visitor pattern. Invokes the method oftargetcorresponding to this instance's type. -
apply
Description copied from class:ChangeApply 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:
equalsin classFieldChange<T>
-
hashCode
public int hashCode()- Overrides:
hashCodein classFieldChange<T>
-
toString
-