Class YEvent

java.lang.Object
io.keikai.doc.collab.utils.YEvent
Direct Known Subclasses:
YArrayEvent, YMapEvent, YTextEvent, YXmlEvent

public class YEvent extends Object
YEvent describes the changes on a YType.
  • Field Details

    • ERROR_COMPUTE_CHANGES

      public static final String ERROR_COMPUTE_CHANGES
      See Also:
    • _target

      protected final AbstractType _target
      The type on which this event was created on.
    • _currentTarget

      protected AbstractType _currentTarget
      The current target on which the observe callback is called.
    • _transaction

      protected final Transaction _transaction
      The transaction that triggered this event.
  • Constructor Details

  • Method Details

    • getTarget

      public AbstractType getTarget()
    • setCurrentTarget

      public void setCurrentTarget(AbstractType currentTarget)
    • getTransaction

      public Transaction getTransaction()
    • getPath

      public List<Object> getPath()
      Computes the path from the YType to the changed type.
      Returns:
      The path from the root type to the target.
    • setPath

      public void setPath(List<Object> path)
    • deletes

      public boolean deletes(AbstractStruct struct)
      Check if a struct is deleted by this event.
      Parameters:
      struct - The struct to check.
      Returns:
      True if the struct is deleted, false otherwise.
    • adds

      public boolean adds(AbstractStruct struct)
      Check if a struct is added by this event.
      Parameters:
      struct - The struct to check.
      Returns:
      True if the struct is added, false otherwise.
    • getKeys

      public Map<String,Change> getKeys()
      Get the changes made to the keys of this event's target.
      Returns:
      A map of the changes made to the keys.
    • getChanges

      public Changes getChanges()
      Get the changes made in this event.
      Returns:
      The changes made.