Class DBSDocumentState


  • public class DBSDocumentState
    extends Object
    Implementation of a Document state for Document-Based Storage.

    It wraps a State, together with a dirty flag.

    Since:
    5.9.4
    • Field Detail

      • state

        protected State state
        The current state.
      • originalState

        protected State originalState
        When non-null, the original state (otherwise the state hasn't been modified).
    • Constructor Detail

      • DBSDocumentState

        public DBSDocumentState()
        Constructs an empty state.
      • DBSDocumentState

        public DBSDocumentState​(State base)
        Constructs a document state from the copy of an existing base state.
    • Method Detail

      • markDirty

        public void markDirty()
        This must be called if we're about to directly change the internal state.
      • isDirty

        public boolean isDirty()
        Checks if the document state has been changed since its construction or the last call to setNotDirty().
      • setNotDirty

        public void setNotDirty()
      • getState

        public State getState()
        Gets the state. If the caller changes the state, it must also call markDirty() to inform this object that the state is dirtied.
      • getStateChange

        public State.StateDiff getStateChange()
        Gets a diff of what changed since this document state was read from database or saved.
        Returns:
        null if there was no change, or a State.StateDiff
      • getOriginalState

        public State getOriginalState()
        Gets the original state for this, needed when creating an undo log.
        Returns:
        a state that must not be modified
        Since:
        7.4
      • containsKey

        public boolean containsKey​(String key)
      • getId

        public String getId()
      • getParentId

        public String getParentId()
      • getName

        public String getName()
      • getPrimaryType

        public String getPrimaryType()
      • getVersionSeriesId

        public String getVersionSeriesId()
      • getSysChangeToken

        public Long getSysChangeToken()
      • getChangeToken

        public Long getChangeToken()
      • validateUserVisibleChangeToken

        public boolean validateUserVisibleChangeToken​(String userVisibleChangeToken)