public class Document extends Object implements org.apache.jackrabbit.oak.cache.CacheValue
DocumentStore.| Modifier and Type | Field and Description |
|---|---|
protected Map<String,Object> |
data
The data of this document.
|
static String |
ID
The name of the field that contains the document id (the primary key /
the key).
|
static String |
MOD_COUNT
The modification count on the document.
|
| Constructor and Description |
|---|
Document() |
| Modifier and Type | Method and Description |
|---|---|
void |
deepCopy(Document target)
Performs a deep copy of the data within this document to the given target.
|
Set<Map.Entry<String,Object>> |
entrySet() |
String |
format()
Formats this document for use in a log message.
|
@Nullable Object |
get(String key)
Gets the data for the given
key. |
@Nullable String |
getId()
Get the id (the primary key) of this document.
|
int |
getMemory() |
@Nullable Long |
getModCount()
Get the modification count of this document.
|
boolean |
isSealed()
Determines if this document is sealed or not
|
Set<String> |
keySet() |
@Nullable Object |
put(String key,
Object value)
Sets the data for the given
key. |
@Nullable Object |
remove(String key)
Removes the given
key. |
void |
seal()
Seals this document and turns it into an immutable object.
|
String |
toString() |
protected @NotNull Map<?,?> |
transformAndSeal(@NotNull Map<Object,Object> map,
@Nullable String key,
int level)
Transform and seal the data of this document.
|
public static final String ID
DocumentStore class.
For nodes, the document id contains the depth of the path (0 for root, 1
for children of the root), and then the path.public static final String MOD_COUNT
DocumentStore implementation may use it to keep track of how many
times a document is modified. See also getModCount().@Nullable public @Nullable String getId()
null if none is set.@Nullable public @Nullable Long getModCount()
null if
none is set.@Nullable public @Nullable Object get(String key)
key.key - the key.null.@Nullable public @Nullable Object put(String key, Object value)
key.key - the key.value - the value to set.null if there was none.@Nullable public @Nullable Object remove(String key)
key.key - the key.null if there was none.public Set<Map.Entry<String,Object>> entrySet()
public void seal()
UnsupportedOperationException.public boolean isSealed()
public void deepCopy(Document target)
target - the target document.public String format()
public int getMemory()
getMemory in interface org.apache.jackrabbit.oak.cache.CacheValue@NotNull protected @NotNull Map<?,?> transformAndSeal(@NotNull @NotNull Map<Object,Object> map, @Nullable @Nullable String key, int level)
map - the map to transform.key - the key for the given map or null if the map
is the top level data map.level - the level. Zero for the top level map, one for an entry in
the top level map, etc.Copyright © 2012–2018 The Apache Software Foundation. All rights reserved.