@NotThreadSafe final class BasicDocument extends Object implements Document
Document.Document.Field| Modifier and Type | Field and Description |
|---|---|
(package private) static Function<Map.Entry<? extends CharSequence,Value>,Document.Field> |
CONVERT_ENTRY_TO_FIELD |
private Map<CharSequence,Value> |
fields |
| Constructor and Description |
|---|
BasicDocument() |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Remove all fields from this document.
|
Document |
clone()
Obtain a clone of this document.
|
protected int |
compare(Value value1,
Value value2)
Semantically compare two values.
|
protected int |
compareNonNull(Value value1,
Value value2)
Semantically compare two non-null values.
|
int |
compareTo(Document that)
Compare this Document to the specified Document, taking into account the order of the fields.
|
int |
compareTo(Document that,
boolean enforceFieldOrder)
Compare this Document to the specified Document, optionally comparing the fields in the same order.
|
int |
compareToUsingSimilarFields(Document that)
Compare this Document to the specified Document, without regard to the order of the fields and only using the fields
that are in both documents.
|
int |
compareToWithoutFieldOrder(Document that)
Compare this Document to the specified Document, without regard to the order of the fields.
|
boolean |
equals(Object obj) |
Value |
get(CharSequence fieldName,
Comparable<?> defaultValue)
Gets the value in this document for the given field name.
|
boolean |
has(CharSequence fieldName)
Determine if this contains a field with the given name.
|
boolean |
hasAll(Document that)
Checks if this object contains all of the fields in the supplied document.
|
int |
hashCode() |
Document |
increment(CharSequence name,
Value increment)
Increment the numeric value in the given field by the designated amount.
|
boolean |
isEmpty()
Return whether this document contains no fields and is therefore empty.
|
Iterator<Document.Field> |
iterator() |
Iterable<CharSequence> |
keySet()
Returns this object's fields' names
|
Document |
putAll(Iterable<Document.Field> object)
Sets on this object all name/value pairs from the supplied object.
|
Value |
remove(CharSequence name)
Remove the field with the supplied name, and return the value.
|
Document |
removeAll()
Remove all fields from this document.
|
Document |
setValue(CharSequence name,
Value value)
Set the value for the field with the given name.
|
int |
size()
Return the number of name-value fields in this object.
|
String |
toString() |
finalize, getClass, notify, notifyAll, wait, wait, waitchildren, children, create, create, create, create, create, create, create, field, field, find, find, forEach, get, getArray, getArray, getBigDecimal, getBigDecimal, getBigInteger, getBigInteger, getBoolean, getBoolean, getBytes, getDocument, getDouble, getDouble, getField, getFloat, getFloat, getInteger, getInteger, getLong, getLong, getNumber, getNumber, getOrCreateArray, getOrCreateDocument, getString, getString, increment, increment, increment, increment, isNull, isNullOrMissing, putAll, putAll, putAll, remove, set, set, setArray, setArray, setArray, setBinary, setBoolean, setDocument, setDocument, setNull, setNumber, setNumber, setNumber, setNumber, setNumber, setNumber, setString, setValue, stream, transformforEach, spliteratorstatic final Function<Map.Entry<? extends CharSequence,Value>,Document.Field> CONVERT_ENTRY_TO_FIELD
private final Map<CharSequence,Value> fields
public int size()
Documentpublic boolean isEmpty()
Documentpublic int compareTo(Document that)
DocumentcompareTo in interface DocumentcompareTo in interface Comparable<Document>that - the other Document to be compared to this objectpublic int compareToUsingSimilarFields(Document that)
DocumentcompareToUsingSimilarFields in interface Documentthat - the other Document to be compared to this objectpublic int compareToWithoutFieldOrder(Document that)
DocumentcompareToWithoutFieldOrder in interface Documentthat - the other Document to be compared to this objectpublic int compareTo(Document that, boolean enforceFieldOrder)
DocumentcompareTo in interface Documentthat - the other Document to be compared to this objectenforceFieldOrder - true if the documents should be compared using their existing field order, or
false if the field order should not affect the result.protected int compare(Value value1, Value value2)
null and Value.nullValue() references.value1 - the first value; may be nullvalue2 - the second value; may be nullprotected int compareNonNull(Value value1, Value value2)
null and Value.nullValue() references.value1 - the first value; may be nullvalue2 - the second value; may be nullpublic Iterable<CharSequence> keySet()
Documentpublic Iterator<Document.Field> iterator()
iterator in interface Iterable<Document.Field>public void clear()
Documentpublic boolean has(CharSequence fieldName)
Documentpublic boolean hasAll(Document that)
Documentpublic Value get(CharSequence fieldName, Comparable<?> defaultValue)
Documentpublic Document putAll(Iterable<Document.Field> object)
Documentpublic Document removeAll()
Documentpublic Value remove(CharSequence name)
Documentpublic Document setValue(CharSequence name, Value value)
Documentpublic Document increment(CharSequence name, Value increment)
Documentpublic Document clone()
DocumentCopyright © 2019 JBoss by Red Hat. All rights reserved.