Package io.keikai.model.impl
Class RevisionLogImpl
java.lang.Object
io.keikai.model.impl.RevisionLogImpl
- All Implemented Interfaces:
SRevisionLog,Serializable
Default implementation of
SRevisionLog.- Since:
- 7.0.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAccepts all tracked revisions.voidacceptRevision(long id) Accepts the specified revision.voidaddRevision(SRevision revision) Adds a revision to the log.Returns all tracked revisions in chronological order.booleanReturns whether change tracking is currently enabled.longReturns the next available revision ID and increments the counter.voidRejects all tracked revisions.voidrejectRevision(long id) Rejects the specified revision.voidsetNextRevisionId(long nextId) Sets the next revision ID.voidStarts tracking changes.voidStops tracking changes.
-
Constructor Details
-
RevisionLogImpl
public RevisionLogImpl()
-
-
Method Details
-
getRevisions
Description copied from interface:SRevisionLogReturns all tracked revisions in chronological order.- Specified by:
getRevisionsin interfaceSRevisionLog- Returns:
- an unmodifiable list of revisions
-
isTracking
public boolean isTracking()Description copied from interface:SRevisionLogReturns whether change tracking is currently enabled.- Specified by:
isTrackingin interfaceSRevisionLog- Returns:
- true if tracking is enabled
-
startTracking
public void startTracking()Description copied from interface:SRevisionLogStarts tracking changes. New modifications will be recorded as revisions.- Specified by:
startTrackingin interfaceSRevisionLog
-
stopTracking
public void stopTracking()Description copied from interface:SRevisionLogStops tracking changes. No new revisions will be recorded.- Specified by:
stopTrackingin interfaceSRevisionLog
-
acceptRevision
public void acceptRevision(long id) Description copied from interface:SRevisionLogAccepts the specified revision. The change is kept and the revision record is removed.- Specified by:
acceptRevisionin interfaceSRevisionLog- Parameters:
id- the revision ID to accept
-
rejectRevision
public void rejectRevision(long id) Description copied from interface:SRevisionLogRejects the specified revision. The change is undone and the revision record is removed.- Specified by:
rejectRevisionin interfaceSRevisionLog- Parameters:
id- the revision ID to reject
-
acceptAll
public void acceptAll()Description copied from interface:SRevisionLogAccepts all tracked revisions.- Specified by:
acceptAllin interfaceSRevisionLog
-
rejectAll
public void rejectAll()Description copied from interface:SRevisionLogRejects all tracked revisions.- Specified by:
rejectAllin interfaceSRevisionLog
-
addRevision
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
-