Package io.permazen.change
Class SimpleFieldChange<T,V>
java.lang.Object
io.permazen.change.Change<T>
io.permazen.change.FieldChange<T>
io.permazen.change.SimpleFieldChange<T,V>
- Type Parameters:
T
- the type of the object containing the changed fieldV
- the type of the changed field
Notification object that gets passed to
@OnChange
-annotated methods when a simple field changes.-
Constructor Summary
ConstructorDescriptionSimpleFieldChange
(T jobj, String fieldName, V oldValue, V newValue) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
apply
(PermazenTransaction jtx, PermazenObject jobj) Apply this change to the given object in the given transaction.boolean
Get the value of the field after the change.Get the value of the field 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
-
SimpleFieldChange
Constructor.- Parameters:
jobj
- Java object containing the field that changedfieldName
- the name of the field that changedoldValue
- the old field valuenewValue
- the new field value- 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. -
getOldValue
Get the value of the field before the change.- Returns:
- the old field value
-
getNewValue
Get the value of the field after the change.- Returns:
- the new field value
-
equals
- Overrides:
equals
in classFieldChange<T>
-
hashCode
public int hashCode()- Overrides:
hashCode
in classFieldChange<T>
-
toString
-