@groovy.transform.Trait @groovy.transform.CompileStatic trait DirtyCheckable extends java.lang.Object
Interface to classes that are able to track changes to their internal state.
Type Params | Return Type | Name and description |
---|---|---|
|
java.lang.Object |
getOriginalValue(java.lang.String propertyName) Returns the original value of the property prior to when trackChanges() was called |
|
boolean |
hasChanged()
|
|
boolean |
hasChanged(java.lang.String propertyName)
|
|
java.util.List<java.lang.String> |
listDirtyPropertyNames()
|
|
void |
markDirty() Marks the whole class and all its properties as dirty. |
|
void |
markDirty(java.lang.String propertyName) Marks the given property name as dirty |
|
void |
markDirty(java.lang.String propertyName, java.lang.Object newValue) Marks the given property name as dirty |
|
void |
markDirty(java.lang.String propertyName, java.lang.Object newValue, java.lang.Object oldValue) Marks the given property name as dirty |
|
void |
syncChangedProperties(java.lang.Object o) Sync the changes for a given instance with this instance. |
|
void |
trackChanges() Indicates that the instance should start tacking changes. |
|
void |
trackChanges(java.util.Map<java.lang.String, java.lang.Object> changedProperties) Initialises the changes with the given changes. |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Returns the original value of the property prior to when trackChanges() was called
propertyName
- The property name
propertyName
- The name of the property
Marks the whole class and all its properties as dirty. When called any future call to any of the hasChanged methods will return true.
Marks the given property name as dirty
propertyName
- The property nameMarks the given property name as dirty
propertyName
- The property namenewValue
- The new valueMarks the given property name as dirty
propertyName
- The property namenewValue
- The new valueSync the changes for a given instance with this instance.
o
- a given objectIndicates that the instance should start tacking changes. Note that if the instance is dirty this will clear any previously tracked changes
Initialises the changes with the given changes.
changedProperties
- The changes.