Class RevisionLogImpl

java.lang.Object
io.keikai.model.impl.RevisionLogImpl
All Implemented Interfaces:
SRevisionLog, Serializable

public class RevisionLogImpl extends Object implements SRevisionLog, Serializable
Default implementation of SRevisionLog.
Since:
7.0.0
See Also:
  • Constructor Details

    • RevisionLogImpl

      public RevisionLogImpl()
  • Method Details

    • getRevisions

      public List<SRevision> getRevisions()
      Description copied from interface: SRevisionLog
      Returns all tracked revisions in chronological order.
      Specified by:
      getRevisions in interface SRevisionLog
      Returns:
      an unmodifiable list of revisions
    • isTracking

      public boolean isTracking()
      Description copied from interface: SRevisionLog
      Returns whether change tracking is currently enabled.
      Specified by:
      isTracking in interface SRevisionLog
      Returns:
      true if tracking is enabled
    • startTracking

      public void startTracking()
      Description copied from interface: SRevisionLog
      Starts tracking changes. New modifications will be recorded as revisions.
      Specified by:
      startTracking in interface SRevisionLog
    • stopTracking

      public void stopTracking()
      Description copied from interface: SRevisionLog
      Stops tracking changes. No new revisions will be recorded.
      Specified by:
      stopTracking in interface SRevisionLog
    • acceptRevision

      public void acceptRevision(long id)
      Description copied from interface: SRevisionLog
      Accepts the specified revision. The change is kept and the revision record is removed.
      Specified by:
      acceptRevision in interface SRevisionLog
      Parameters:
      id - the revision ID to accept
    • rejectRevision

      public void rejectRevision(long id)
      Description copied from interface: SRevisionLog
      Rejects the specified revision. The change is undone and the revision record is removed.
      Specified by:
      rejectRevision in interface SRevisionLog
      Parameters:
      id - the revision ID to reject
    • acceptAll

      public void acceptAll()
      Description copied from interface: SRevisionLog
      Accepts all tracked revisions.
      Specified by:
      acceptAll in interface SRevisionLog
    • rejectAll

      public void rejectAll()
      Description copied from interface: SRevisionLog
      Rejects all tracked revisions.
      Specified by:
      rejectAll in interface SRevisionLog
    • addRevision

      public void addRevision(SRevision revision)
      Adds a revision to the log. Should only be called when tracking is enabled.
      Parameters:
      revision - the revision to add
    • nextRevisionId

      public long nextRevisionId()
      Returns the next available revision ID and increments the counter.
      Returns:
      the next revision ID
    • setNextRevisionId

      public void setNextRevisionId(long nextId)
      Sets the next revision ID. Used during import to continue numbering.
      Parameters:
      nextId - the next ID to use