public class DBSDocumentState extends Object
Document
state for Document-Based Storage.
It wraps a State
, together with a dirty flag.
Modifier and Type | Field and Description |
---|---|
protected State |
originalState
When non-null, the original state (otherwise the state hasn't been modified).
|
protected State |
state
The current state.
|
Constructor and Description |
---|
DBSDocumentState()
Constructs an empty state.
|
DBSDocumentState(State base)
Constructs a document state from the copy of an existing base state.
|
Modifier and Type | Method and Description |
---|---|
boolean |
containsKey(String key) |
Serializable |
get(String key) |
Long |
getChangeToken() |
String |
getId() |
String |
getName() |
State |
getOriginalState()
Gets the original state for this, needed when creating an undo log.
|
String |
getParentId() |
String |
getPrimaryType() |
State |
getState()
Gets the state.
|
State.StateDiff |
getStateChange()
Gets a diff of what changed since this document state was read from database or saved.
|
Long |
getSysChangeToken() |
String |
getVersionSeriesId() |
boolean |
isDirty()
Checks if the document state has been changed since its construction or the last call to
setNotDirty() . |
void |
markDirty()
This must be called if we're about to directly change the internal state.
|
void |
put(String key,
Serializable value) |
void |
setNotDirty() |
String |
toString() |
boolean |
validateUserVisibleChangeToken(String userVisibleChangeToken) |
protected State originalState
public DBSDocumentState()
public DBSDocumentState(State base)
public void markDirty()
public boolean isDirty()
setNotDirty()
.public void setNotDirty()
public State getState()
#dirty
to inform this object that the
state is dirtied.public State.StateDiff getStateChange()
null
if there was no change, or a State.StateDiff
public State getOriginalState()
public Serializable get(String key)
public void put(String key, Serializable value)
public boolean containsKey(String key)
public String getParentId()
public String getPrimaryType()
public String getVersionSeriesId()
public Long getSysChangeToken()
public Long getChangeToken()
public boolean validateUserVisibleChangeToken(String userVisibleChangeToken)
Copyright © 2018 Nuxeo. All rights reserved.