Interface Change

  • All Known Subinterfaces:
    ChangeInternal

    public interface Change
    A model change.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Interface Description
      static class  Change.ChangeType
      Change Type
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      void apply​(VObject obj)
      Applies this change to the specified object.
      long getTimestamp()
      Returns the timestamp (in nano seconds) which denotes the creation of this change.
      Change.ChangeType getType()
      Returns the type of this change.
      boolean isUndoable()
      Indicates whether this change can be reverted.
      default java.util.Optional<eu.mihosoft.vcollections.VListChangeEvent<java.lang.Object>> listChange()
      Returns the list change (optional) which exists if this change affects a list (list elements added, removed, etc.).
      VObject object()
      Returns the object affected by this change
      default java.util.Optional<PropertyChange> propertyChange()
      Returns the property change (optional) which exists if this change affects a single property.
      java.lang.String propertyName()
      Returns the name of the property affected by this change.
      void undo()
      Performs an undo operation (if possible).
    • Method Detail

      • object

        VObject object()
        Returns the object affected by this change
        Returns:
        the object affected by this change
      • propertyName

        java.lang.String propertyName()
        Returns the name of the property affected by this change.
        Returns:
        the name of the property affected by this change
      • undo

        void undo()
        Performs an undo operation (if possible).
      • apply

        void apply​(VObject obj)
        Applies this change to the specified object.
        Parameters:
        obj - target object affected by this change
      • isUndoable

        boolean isUndoable()
        Indicates whether this change can be reverted.
        Returns:
        true if this change can be reverted; false otherwise
      • propertyChange

        default java.util.Optional<PropertyChange> propertyChange()
        Returns the property change (optional) which exists if this change affects a single property.
        Returns:
        the property change (optional)
      • listChange

        default java.util.Optional<eu.mihosoft.vcollections.VListChangeEvent<java.lang.Object>> listChange()
        Returns the list change (optional) which exists if this change affects a list (list elements added, removed, etc.).
        Returns:
        the list change (optional)
      • getType

        Change.ChangeType getType()
        Returns the type of this change.
        Returns:
        the type of this change
      • getTimestamp

        long getTimestamp()
        Returns the timestamp (in nano seconds) which denotes the creation of this change.
        Returns:
        the timestamp (in nano seconds) which denotes the creation of this change