Interface BasicDirtyTracker
- All Known Subinterfaces:
DirtyStateTrackable
,DirtyTracker
,MutableStateTrackable
public interface BasicDirtyTracker
A dirty tracker records the fact that an object was possibly altered
and allows to query this information.
- Since:
- 1.2.0
- Author:
- Christian Beikov
-
Method Summary
Modifier and Type Method Description boolean
$$_hasParent()
Whether this dirty tracked object has a parent dirty tracker.boolean
$$_isDirty()
Whether a mutating action was invoked that could have possibly altered the state.void
$$_markDirty(int attributeIndex)
Marks the attribute with the given index as dirty.void
$$_setParent(BasicDirtyTracker parent, int parentIndex)
Sets the mutable parent of the object.void
$$_unmarkDirty()
Unmarks this object as dirty usually done after flushing.void
$$_unsetParent()
Unsets the parent of the dirty tracked object.
-
Method Details
-
$$_isDirty
boolean $$_isDirty()Whether a mutating action was invoked that could have possibly altered the state.- Returns:
- True if maybe dirty, otherwise false
-
$$_markDirty
void $$_markDirty(int attributeIndex)Marks the attribute with the given index as dirty.- Parameters:
attributeIndex
- The attribute index
-
$$_unmarkDirty
void $$_unmarkDirty()Unmarks this object as dirty usually done after flushing. -
$$_setParent
Sets the mutable parent of the object.- Parameters:
parent
- The new parent objectparentIndex
- The new attribute index of this object in the parent object- Throws:
IllegalStateException
- If a parent is already set
-
$$_hasParent
boolean $$_hasParent()Whether this dirty tracked object has a parent dirty tracker.- Returns:
- true if this dirty tracked object has a parent dirty tracker, false otherwise
-
$$_unsetParent
void $$_unsetParent()Unsets the parent of the dirty tracked object.
-