Class FieldChange<T>

java.lang.Object
io.permazen.change.Change<T>
io.permazen.change.FieldChange<T>
Type Parameters:
T - the type of the object containing the changed field
Direct Known Subclasses:
ListFieldChange, MapFieldChange, SetFieldChange, SimpleFieldChange

public abstract class FieldChange<T> extends Change<T>
Notification object that gets passed to @OnChange-annotated methods when a field changes.

Note that it's possible, using the core API, to change a field without first updating the containing object's schema. As older schemas may have different fields than the schema associated with a particular Permazen instance, it's therefore possible to receive change notifications about changes to fields not present in the current schema. This will not happen unless the lower level core API is used directly, FieldChange events are being generated manually, etc.

  • Constructor Details

    • FieldChange

      protected FieldChange(T jobj, String fieldName)
      Constructor.
      Parameters:
      jobj - Java object containing the field that changed
      fieldName - the name of the field that changed
      Throws:
      IllegalArgumentException - if jobj or fieldName is null
  • Method Details

    • getFieldName

      public String getFieldName()
      Get the name of the field that changed.
      Returns:
      the name of the field that changed
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Change<T>
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Change<T>