|
ModeShape Distribution 3.0.0.CR1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractMap<K,V>
java.util.HashMap<K,V>
java.util.LinkedHashMap<String,Object>
org.infinispan.schematic.internal.document.BasicDocument
@SerializeWith(value=DocumentExternalizer.class) public class BasicDocument
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.util.AbstractMap |
|---|
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V> |
| Nested classes/interfaces inherited from interface org.infinispan.schematic.document.Document |
|---|
Document.Field, Document.ValueTransformer |
| Constructor Summary | |
|---|---|
BasicDocument()
|
|
BasicDocument(int initialCapacity)
|
|
BasicDocument(String name,
Object value)
|
|
BasicDocument(String name1,
Object value1,
String name2,
Object value2)
|
|
BasicDocument(String name1,
Object value1,
String name2,
Object value2,
String name3,
Object value3)
|
|
BasicDocument(String name1,
Object value1,
String name2,
Object value2,
String name3,
Object value3,
String name4,
Object value4)
|
|
| Method Summary | |
|---|---|
Document |
clone()
Obtain a clone of this document. |
boolean |
containsAll(Document document)
Checks if this object contains all of the fields in the supplied document. |
boolean |
containsField(String name)
Checks if this object contains a field with the given name. |
boolean |
equals(Object obj)
|
Iterable<Document.Field> |
fields()
Obtain an iterator over the Document.Fields in this object. |
Object |
get(String name)
Gets the value in this document for the given field name. |
List<?> |
getArray(String name)
Get the array value in this document for the given field name. |
Binary |
getBinary(String name)
Get the Binary value in this document for the given field name. |
Boolean |
getBoolean(String name)
Get the boolean value in this document for the given field name. |
boolean |
getBoolean(String name,
boolean defaultValue)
Get the boolean value in this document for the given field name. |
Code |
getCode(String name)
Get the Code value in this document for the given field name. |
CodeWithScope |
getCodeWithScope(String name)
Get the CodeWithScope value in this document for the given field name. |
Document |
getDocument(String name)
Get the document value in this document for the given field name. |
Double |
getDouble(String name)
Get the double value in this document for the given field name. |
double |
getDouble(String name,
double defaultValue)
Get the double value in this document for the given field name. |
Integer |
getInteger(String name)
Get the integer value in this document for the given field name. |
int |
getInteger(String name,
int defaultValue)
Get the integer value in this document for the given field name. |
Long |
getLong(String name)
Get the integer value in this document for the given field name. |
long |
getLong(String name,
long defaultValue)
Get the long value in this document for the given field name. |
MaxKey |
getMaxKey(String name)
Get the MaxKey value in this document for the given field name. |
MinKey |
getMinKey(String name)
Get the MinKey value in this document for the given field name. |
Number |
getNumber(String name)
Get the number value in this document for the given field name. |
Number |
getNumber(String name,
Number defaultValue)
Get the number value in this document for the given field name. |
ObjectId |
getObjectId(String name)
Get the ObjectId value in this document for the given field name. |
Pattern |
getPattern(String name)
Get the Pattern value in this document for the given field name. |
String |
getString(String name)
Get the string value in this document for the given field name. |
String |
getString(String name,
String defaultValue)
Get the string value in this document for the given field name. |
Symbol |
getSymbol(String name)
Get the Symbol value in this document for the given field name. |
int |
getType(String name)
Get the Bson.Type constant that describes the type of value for the given field name. |
UUID |
getUuid(String name)
Get the UUID value in this document for the given field name. |
UUID |
getUuid(String name,
UUID defaultValue)
Get the UUID value in this document for the given field name. |
boolean |
isNull(String name)
Determine whether this object has a pair with the given the name and the value is null. |
boolean |
isNullOrMissing(String name)
Determine whether this object has a pair with the given the name and the value is null, or if this object has no field with the given name. |
void |
putAll(Document object)
Sets on this object all name/value pairs from the supplied object. |
Object |
remove(String name)
Removes from this object the name/value pair with the given name. |
void |
removeAll()
Remove all fields from this document. |
Map<String,?> |
toMap()
Returns a map representing this BSONObject. |
String |
toString()
|
Document |
with(Document.ValueTransformer transformer)
Obtain a clone of this document, but with the field values transformed using the supplied Document.ValueTransformer. |
Document |
with(Map<String,Object> changedFields)
Obtain a clone of this document, but with the supplied fields replaced. |
Document |
withVariablesReplaced(Properties properties)
Obtain a clone of this document, but with all variables in string field values replaced with the referenced values from the supplied properties. |
Document |
withVariablesReplacedWithSystemProperties()
Obtain a clone of this document, but with all variables in string field values replaced with the referenced values from the System properties. |
| Methods inherited from class java.util.LinkedHashMap |
|---|
clear, containsValue, get, removeEldestEntry |
| Methods inherited from class java.util.HashMap |
|---|
containsKey, entrySet, isEmpty, keySet, put, putAll, remove, size, values |
| Methods inherited from class java.util.AbstractMap |
|---|
hashCode |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.infinispan.schematic.internal.document.MutableDocument |
|---|
put, putAll |
| Methods inherited from interface org.infinispan.schematic.document.Document |
|---|
isEmpty, keySet, size |
| Methods inherited from interface java.util.Map |
|---|
containsKey, entrySet, hashCode, isEmpty, keySet, put, putAll, remove, size, values |
| Constructor Detail |
|---|
public BasicDocument()
public BasicDocument(int initialCapacity)
public BasicDocument(String name,
Object value)
public BasicDocument(String name1,
Object value1,
String name2,
Object value2)
public BasicDocument(String name1,
Object value1,
String name2,
Object value2,
String name3,
Object value3)
public BasicDocument(String name1,
Object value1,
String name2,
Object value2,
String name3,
Object value3,
String name4,
Object value4)
| Method Detail |
|---|
public boolean containsField(String name)
Document
containsField in interface Documentname - The name of the pair for which to check
public boolean containsAll(Document document)
Document
containsAll in interface Documentdocument - The document with the fields that should be in this document
public Object get(String name)
Document
get in interface Documentname - The name of the pair
public Map<String,?> toMap()
Document
toMap in interface Documentpublic Iterable<Document.Field> fields()
DocumentDocument.Fields in this object.
fields in interface Documentpublic Boolean getBoolean(String name)
Document
getBoolean in interface Documentname - The name of the pair
public boolean getBoolean(String name,
boolean defaultValue)
Document
getBoolean in interface Documentname - The name of the pairdefaultValue - the default value to return if there is no such pair or if the value is not a boolean
defaultValue if there is no such pair or if the value is not a
booleanpublic Integer getInteger(String name)
Document
getInteger in interface Documentname - The name of the pair
public int getInteger(String name,
int defaultValue)
Document
getInteger in interface Documentname - The name of the pairdefaultValue - the default value to return if there is no such pair or if the value is not a integer
defaultValue if there is no such pair or if the value is not a
integerpublic Long getLong(String name)
Document
getLong in interface Documentname - The name of the pair
public long getLong(String name,
long defaultValue)
Document
getLong in interface Documentname - The name of the pairdefaultValue - the default value to return if there is no such pair or if the value is not a long value
defaultValue if there is no such pair or if the value is not a long
valuepublic Double getDouble(String name)
Document
getDouble in interface Documentname - The name of the pair
public double getDouble(String name,
double defaultValue)
Document
getDouble in interface Documentname - The name of the pairdefaultValue - the default value to return if there is no such pair or if the value is not a double
defaultValue if there is no such pair or if the value is not a
doublepublic Number getNumber(String name)
Document
getNumber in interface Documentname - The name of the pair
public Number getNumber(String name,
Number defaultValue)
Document
getNumber in interface Documentname - The name of the pairdefaultValue - the default value to return if there is no such pair or if the value is not a number
defaultValue if there is no such pair or if the value is not a
numberpublic String getString(String name)
DocumentSymbol.
getString in interface Documentname - The name of the pair
public String getString(String name,
String defaultValue)
DocumentSymbol.
getString in interface Documentname - The name of the pairdefaultValue - the default value to return if there is no such pair or if the value is not a string
defaultValue if there is no such pair or if the value is not a
stringpublic List<?> getArray(String name)
Document
getArray in interface Documentname - The name of the pair
public Document getDocument(String name)
Document
getDocument in interface Documentname - The name of the pair
public boolean isNull(String name)
Documentthis.get(name) instanceof Null;
isNull in interface Documentname - The name of the pair
true if the field has been set to a Null value, or false otherwiseDocument.isNullOrMissing(String)public boolean isNullOrMissing(String name)
DocumentNull.matches(this.get(name));
isNullOrMissing in interface Documentname - The name of the pair
true if the field value for the name is null or if there is no such field.Document.isNull(String)public MaxKey getMaxKey(String name)
DocumentMaxKey value in this document for the given field name.
getMaxKey in interface Documentname - The name of the pair
MaxKey field value, if found, or null if there is no such pair or if the value is not a MaxKeypublic MinKey getMinKey(String name)
DocumentMinKey value in this document for the given field name.
getMinKey in interface Documentname - The name of the pair
MinKey field value, if found, or null if there is no such pair or if the value is not a MinKeypublic Code getCode(String name)
DocumentCode value in this document for the given field name.
getCode in interface Documentname - The name of the pair
Code field value, if found, or null if there is no such pair or if the value is not a Codepublic CodeWithScope getCodeWithScope(String name)
DocumentCodeWithScope value in this document for the given field name.
getCodeWithScope in interface Documentname - The name of the pair
CodeWithScope field value, if found, or null if there is no such pair or if the value is not a
CodeWithScopepublic ObjectId getObjectId(String name)
DocumentObjectId value in this document for the given field name.
getObjectId in interface Documentname - The name of the pair
ObjectId field value, if found, or null if there is no such pair or if the value is not a
ObjectIdpublic Binary getBinary(String name)
DocumentBinary value in this document for the given field name.
getBinary in interface Documentname - The name of the pair
Binary field value, if found, or null if there is no such pair or if the value is not a Binarypublic Symbol getSymbol(String name)
DocumentSymbol value in this document for the given field name.
getSymbol in interface Documentname - The name of the pair
Symbol field value, if found, or null if there is no such pair or if the value is not a Symbolpublic Pattern getPattern(String name)
DocumentPattern value in this document for the given field name.
getPattern in interface Documentname - The name of the pair
Pattern field value, if found, or null if there is no such pair or if the value is not a
Patternpublic UUID getUuid(String name)
DocumentUUID value in this document for the given field name.
getUuid in interface Documentname - The name of the pair
UUID field value, if found, or null if there is no such pair or if the value is not a UUID
public UUID getUuid(String name,
UUID defaultValue)
DocumentUUID value in this document for the given field name.
getUuid in interface Documentname - The name of the pairdefaultValue - the default value to return if there is no such pair or if the value is not a string
UUID field value if found, or defaultValue if there is no such pair or if the value is not
a UUID (or a string that is convertable from a UUID)public int getType(String name)
DocumentBson.Type constant that describes the type of value for the given field name.
getType in interface Documentname - The name of the pair
Bson.Type constant describing the value, or -1 if there is no field with the supplied namepublic void putAll(Document object)
MutableDocument
putAll in interface MutableDocumentobject - the object containing the name/value pairs to be set on this objectpublic Object remove(String name)
MutableDocument
remove in interface MutableDocumentname - The name of the pair to remove
public void removeAll()
MutableDocument
removeAll in interface MutableDocumentpublic boolean equals(Object obj)
equals in interface Map<String,Object>equals in class AbstractMap<String,Object>public String toString()
toString in class AbstractMap<String,Object>public Document clone()
Document
clone in interface Documentclone in class HashMap<String,Object>public Document with(Map<String,Object> changedFields)
Document
with in interface DocumentchangedFields - the fields that should be changed; may be null
public Document with(Document.ValueTransformer transformer)
DocumentDocument.ValueTransformer.
with in interface Documenttransformer - the transformer that should be used to transform each field value; may not be null
public Document withVariablesReplaced(Properties properties)
DocumentVariables may appear anywhere within a string value, and multiple variables can be used within the same value. Variables take the form:
variable := '${' variableNames [ ':' defaultValue ] '}'
variableNames := variableName [ ',' variableNames ]
variableName := /* any characters except ',' and ':' and '}'
defaultValue := /* any characters except
Note that variableName is the name used to look up the Properties property.
Notice that the syntax supports multiple variables. The logic will process the variables from let to right,
until an existing System property is found. And at that point, it will stop and will not attempt to find values for the
other variables.
withVariablesReplaced in interface Documentproperties - the properties keyed by variable name
Document.withVariablesReplacedWithSystemProperties(),
Document.with(ValueTransformer),
SchemaLibrary.convertValues(Document, String)public Document withVariablesReplacedWithSystemProperties()
DocumentVariables may appear anywhere within a string value, and multiple variables can be used within the same value. Variables take the form:
variable := '${' variableNames [ ':' defaultValue ] '}'
variableNames := variableName [ ',' variableNames ]
variableName := /* any characters except ',' and ':' and '}'
defaultValue := /* any characters except
Note that variableName is the name used to look up a System property via System.getProperty(String).
Notice that the syntax supports multiple variables. The logic will process the variables from let to right,
until an existing System property is found. And at that point, it will stop and will not attempt to find values for the
other variables.
Because only string values can contain variables, the resulting values are left as strings. This may not be valid according
to the document's JSON Schema, so see SchemaLibrary.convertValues(Document, String) to convert the string values
after variable substitution into the expected non-string types.
withVariablesReplacedWithSystemProperties in interface DocumentDocument.withVariablesReplaced(Properties),
Document.with(ValueTransformer),
SchemaLibrary.convertValues(Document, String)
|
ModeShape Distribution 3.0.0.CR1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||