|
ModeShape Distribution 3.0.0.Beta4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface EditableArray
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.infinispan.schematic.document.Array |
---|
Array.Entry |
Nested classes/interfaces inherited from interface org.infinispan.schematic.document.Document |
---|
Document.Field, Document.ValueTransformer |
Method Summary | |
---|---|
EditableArray |
addArray()
Adds to this array a new empty array. |
EditableArray |
addArray(Array array)
Adds to this array the supplied array. |
EditableArray |
addArray(int index)
Insert the value for the field at the given index to be a new, empty array. |
EditableArray |
addArray(int index,
Array array)
Insert the value for the field at the given index to be the supplied array. |
EditableArray |
addArrayIfAbsent(Array array)
Adds to this array the supplied array, if and only if an equivalent value doesn't already exist in the array. |
EditableArray |
addBinary(byte type,
byte[] data)
Adds to this array a Binary value with the supplied type and content. |
EditableArray |
addBinary(int index,
byte type,
byte[] data)
Insert the value for the field at the given index to be a binary value. |
EditableArray |
addBinaryIfAbsent(byte type,
byte[] data)
Adds to this array a Binary value with the supplied type and content, if and only if an equivalent value doesn't
already exist in the array. |
EditableArray |
addBoolean(boolean value)
Adds the supplied boolean value to this array. |
EditableArray |
addBoolean(int index,
boolean value)
Insert the value for the field at the given index to the supplied boolean value. |
EditableArray |
addBooleanIfAbsent(boolean value)
Adds the supplied boolean value to this array, if and only if an equivalent value doesn't already exist in the array. |
EditableDocument |
addCode(int index,
String code,
boolean includeScope)
Insert the value for the field at the given index to be a Code or CodeWithScope . |
EditableDocument |
addCode(int index,
String code,
Document scope)
Insert the value for the field at the given index to be a Code or CodeWithScope . |
EditableDocument |
addCode(String code,
boolean includeScope)
Adds to this array a Code with the supplied JavaScript code. |
EditableDocument |
addCode(String code,
Document scope)
Adds to this array a CodeWithScope with the supplied JavaScript code and scope. |
EditableDocument |
addCodeIfAbsent(String code,
Document scope)
Adds to this array a CodeWithScope with the supplied JavaScript code and scope, if and only if an equivalent value
doesn't already exist in the array. |
EditableArray |
addDate(Date value)
Adds to this array the supplied date. |
EditableArray |
addDate(int index,
Date value)
Insert the value for the field at the given index to the supplied date value. |
EditableArray |
addDate(int index,
String isoDate)
Insert the value for the field at the given index to the date value parsed from the ISO-8601 date representation. |
EditableArray |
addDate(String isoDate)
Adds to this array a Date with the supplied ISO-8601 string. |
EditableArray |
addDateIfAbsent(Date value)
Adds to this array the supplied date, if and only if an equivalent value doesn't already exist in the array. |
EditableArray |
addDateIfAbsent(String isoDate)
Adds to this array a Date with the supplied ISO-8601 string, if and only if an equivalent value doesn't already exist in the array. |
EditableDocument |
addDocument()
Adds to this array a new empty document. |
EditableDocument |
addDocument(Document document)
Adds to this array the supplied document. |
EditableDocument |
addDocument(int index)
Insert the value for the field at the given index to be a new, empty Document. |
EditableDocument |
addDocument(int index,
Document document)
Insert the value for the field at the given index to be the supplied Document. |
EditableDocument |
addDocumentIfAbsent(Document document)
Adds to this array the supplied document, if and only if an equivalent value doesn't already exist in the array. |
EditableArray |
addNull()
Adds to this array a Null value. |
EditableArray |
addNull(int index)
Insert the value for the field at the given index to be a null value. |
EditableArray |
addNullIfAbsent()
Adds to this array a Null value, if and only if there is not already a null value in the array. |
EditableArray |
addNumber(double value)
Adds the supplied double value to this array. |
EditableArray |
addNumber(float value)
Adds the supplied float value to this array. |
EditableArray |
addNumber(int value)
Adds the supplied integer value to this array. |
EditableArray |
addNumber(int index,
double value)
Insert the value for the field at the given index to the supplied double value. |
EditableArray |
addNumber(int index,
float value)
Insert the value for the field at the given index to the supplied float value. |
EditableArray |
addNumber(int index,
int value)
Insert the value for the field at the given index to the supplied integer value. |
EditableArray |
addNumber(int index,
long value)
Insert the value for the field at the given index to the supplied long value. |
EditableArray |
addNumber(long value)
Adds the supplied long value to this array. |
EditableArray |
addNumberIfAbsent(double value)
Adds the supplied double value to this array, if and only if an equivalent value doesn't already exist in the array. |
EditableArray |
addNumberIfAbsent(float value)
Adds the supplied float value to this array, if and only if an equivalent value doesn't already exist in the array. |
EditableArray |
addNumberIfAbsent(int value)
Adds the supplied integer value to this array, if and only if an equivalent value doesn't already exist in the array. |
EditableArray |
addNumberIfAbsent(long value)
Adds the supplied long value to this array, if and only if an equivalent value doesn't already exist in the array. |
EditableArray |
addObjectId(byte[] bytes)
Adds to this array an ObjectId with the supplied 12-byte value. |
EditableArray |
addObjectId(int index,
byte[] bytes)
Insert the value for the field at the given index to an ObjectId created from the supplied 12-byte binary value. |
EditableArray |
addObjectId(int time,
int machine,
int process,
int inc)
Adds to this array an ObjectId with the supplied time, machine, process, and increment. |
EditableArray |
addObjectId(int index,
int time,
int machine,
int process,
int inc)
Insert the value for the field at the given index to an ObjectId created from the supplied hexadecimal binary
value. |
EditableArray |
addObjectId(int index,
String hex)
Insert the value for the field at the given index to an ObjectId created from the supplied hexadecimal binary
value. |
EditableArray |
addObjectId(String hex)
Adds to this array an ObjectId with the supplied hexadecimal string. |
EditableArray |
addObjectIdIfAbsent(byte[] bytes)
Adds to this array an ObjectId with the supplied 12-byte value, if and only if an equivalent value doesn't already exist in the array. |
EditableArray |
addObjectIdIfAbsent(int time,
int machine,
int process,
int inc)
Adds to this array an ObjectId with the supplied time, machine, process, and increment, if and only if an equivalent value doesn't already exist in the array. |
EditableArray |
addObjectIdIfAbsent(String hex)
Adds to this array an ObjectId with the supplied hexadecimal string, if and only if an equivalent value doesn't already exist in the array. |
EditableArray |
addRegularExpression(int index,
String pattern)
Insert the value for the field at the given index to the supplied regular expression. |
EditableArray |
addRegularExpression(int index,
String pattern,
int flags)
Insert the value for the field at the given index to the supplied regular expression. |
EditableArray |
addRegularExpression(String pattern)
Adds to this array a regular expression with the supplied pattern string. |
EditableArray |
addRegularExpression(String pattern,
int flags)
Adds to this array a regular expression with the supplied pattern string and option flags. |
EditableArray |
addRegularExpressionIfAbsent(String pattern)
Adds to this array a regular expression with the supplied pattern string, if and only if an equivalent value doesn't already exist in the array. |
EditableArray |
addRegularExpressionIfAbsent(String pattern,
int flags)
Adds to this array a regular expression with the supplied pattern string and option flags, if and only if an equivalent value doesn't already exist in the array. |
EditableArray |
addString(int index,
String value)
Insert the value for the field at the given index to the supplied string value. |
EditableArray |
addString(String value)
Adds the supplied string value to this array. |
EditableArray |
addStringIfAbsent(String value)
Adds the supplied string value to this array, if and only if an equivalent value doesn't already exist in the array. |
EditableArray |
addSymbol(int index,
String value)
Insert the value for the field at the given index to a Symbol created from the supplied string value. |
EditableArray |
addSymbol(String value)
Adds to this array a Symbol with the supplied string. |
EditableArray |
addSymbolIfAbsent(String value)
Adds to this array a Symbol with the supplied string, if and only if an equivalent value doesn't already exist in the array. |
EditableArray |
addTimestamp(int timeInSeconds,
int increment)
Adds to this array a Timestamp with the supplied time in seconds and increment value. |
EditableArray |
addTimestamp(int index,
int timeInSeconds,
int increment)
Insert the value for the field at the given index to a Timestamp with the supplied time in seconds and increment. |
EditableArray |
addTimestampIfAbsent(int timeInSeconds,
int increment)
Adds to this array a Timestamp with the supplied time in seconds and increment value, if and only if an equivalent value doesn't already exist in the array. |
EditableArray |
addUuid(int index,
UUID uuid)
Insert the value for the field at the given index to be a UUID . |
EditableArray |
addUuid(UUID uuid)
Adds to this array the supplied UUID. |
EditableArray |
addUuidIfAbsent(UUID uuid)
Adds to this array the supplied UUID, if and only if an equivalent value doesn't already exist in the array. |
EditableArray |
addValue(int index,
Object value)
Insert the value for the field with the given name to the supplied value. |
EditableArray |
addValue(Object value)
Add the supplied value to this array. |
EditableDocument |
addValueIfAbsent(Object value)
Add the supplied value to this array if and only if there is not already an equivalent value in the array. |
EditableArray |
getArray(String name)
Get the existing array value in this array for the given index. |
EditableDocument |
getDocument(String name)
Get the existing document value in this array for the given index. |
EditableArray |
set(String name,
Object value)
Set the value for the field with the given name to the supplied value. |
EditableArray |
setArray(int index)
Set the value for the field at the given index to be a new, empty array. |
EditableArray |
setArray(int index,
Array array)
Set the value for the field at the given index to be the supplied array. |
EditableArray |
setArray(String name)
Set the value for the field at the given index to be a new, empty array. |
EditableArray |
setArray(String name,
Array array)
Set the value for the field at the given index to be the supplied array. |
EditableArray |
setBinary(int index,
byte type,
byte[] data)
Set the value for the field at the given index to be a binary value. |
EditableArray |
setBinary(String name,
byte type,
byte[] data)
Set the value for the field at the given index to be a binary value. |
EditableArray |
setBoolean(int index,
boolean value)
Set the value for the field at the given index to the supplied boolean value. |
EditableArray |
setBoolean(String name,
boolean value)
Set the value for the field at the given index to the supplied boolean value. |
EditableDocument |
setCode(int index,
String code,
boolean includeScope)
Set the value for the field at the given index to be a Code or CodeWithScope . |
EditableDocument |
setCode(int index,
String code,
Document scope)
Set the value for the field at the given index to be a Code or CodeWithScope . |
EditableDocument |
setCode(String name,
String code,
boolean includeScope)
Set the value for the field at the given index to be a Code or CodeWithScope . |
EditableDocument |
setCode(String name,
String code,
Document scope)
Set the value for the field at the given index to be a Code or CodeWithScope . |
EditableArray |
setDate(int index,
Date value)
Set the value for the field at the given index to the supplied date value. |
EditableArray |
setDate(int index,
String isoDate)
Set the value for the field at the given index to the date value parsed from the ISO-8601 date representation. |
EditableArray |
setDate(String name,
Date value)
Set the value for the field at the given index to the supplied date value. |
EditableArray |
setDate(String name,
String isoDate)
Set the value for the field at the given index to the date value parsed from the ISO-8601 date representation. |
EditableDocument |
setDocument(int index)
Set the value for the field at the given index to be a new, empty Document. |
EditableDocument |
setDocument(int index,
Document document)
Set the value for the field at the given index to be the supplied Document. |
EditableDocument |
setDocument(String name)
Set the value for the field at the given index to be a new, empty Document. |
EditableDocument |
setDocument(String name,
Document document)
Set the value for the field at the given index to be the supplied Document. |
EditableArray |
setNull(int index)
Set the value for the field at the given index to be a null value. |
EditableArray |
setNull(String name)
Set the value for the field at the given index to be a null value. |
EditableArray |
setNumber(int index,
double value)
Set the value for the field at the given index to the supplied double value. |
EditableArray |
setNumber(int index,
float value)
Set the value for the field at the given index to the supplied float value. |
EditableArray |
setNumber(int index,
int value)
Set the value for the field at the given index to the supplied integer value. |
EditableArray |
setNumber(int index,
long value)
Set the value for the field at the given index to the supplied long value. |
EditableArray |
setNumber(String name,
double value)
Set the value for the field at the given index to the supplied double value. |
EditableArray |
setNumber(String name,
float value)
Set the value for the field at the given index to the supplied float value. |
EditableArray |
setNumber(String name,
int value)
Set the value for the field at the given index to the supplied integer value. |
EditableArray |
setNumber(String name,
long value)
Set the value for the field at the given index to the supplied long value. |
EditableArray |
setObjectId(int index,
byte[] bytes)
Set the value for the field at the given index to an ObjectId created from the supplied 12-byte binary value. |
EditableArray |
setObjectId(int index,
int time,
int machine,
int process,
int inc)
Set the value for the field at the given index to an ObjectId created from the supplied hexadecimal binary value. |
EditableArray |
setObjectId(int index,
String hex)
Set the value for the field at the given index to an ObjectId created from the supplied hexadecimal binary value. |
EditableArray |
setObjectId(String name,
byte[] bytes)
Set the value for the field at the given index to an ObjectId created from the supplied 12-byte binary value. |
EditableArray |
setObjectId(String name,
int time,
int machine,
int process,
int inc)
Set the value for the field at the given index to an ObjectId created from the supplied hexadecimal binary value. |
EditableArray |
setObjectId(String name,
String hex)
Set the value for the field at the given index to an ObjectId created from the supplied hexadecimal binary value. |
EditableArray |
setRegularExpression(int index,
String pattern)
Set the value for the field at the given index to the supplied regular expression. |
EditableArray |
setRegularExpression(int index,
String pattern,
int flags)
Set the value for the field at the given index to the supplied regular expression. |
EditableArray |
setRegularExpression(String name,
String pattern)
Set the value for the field at the given index to the supplied regular expression. |
EditableArray |
setRegularExpression(String name,
String pattern,
int flags)
Set the value for the field at the given index to the supplied regular expression. |
EditableArray |
setString(int index,
String value)
Set the value for the field at the given index to the supplied string value. |
EditableArray |
setString(String name,
String value)
Set the value for the field at the given index to the supplied string value. |
EditableArray |
setSymbol(int index,
String value)
Set the value for the field at the given index to a Symbol created from the supplied string value. |
EditableArray |
setSymbol(String name,
String value)
Set the value for the field at the given index to a Symbol created from the supplied string value. |
EditableArray |
setTimestamp(int index,
int timeInSeconds,
int increment)
Set the value for the field at the given index to a Timestamp with the supplied time in seconds and increment. |
EditableArray |
setTimestamp(String name,
int timeInSeconds,
int increment)
Set the value for the field at the given index to a Timestamp with the supplied time in seconds and increment. |
EditableArray |
setUuid(int index,
UUID uuid)
Set the value for the field at the given index to be a UUID . |
EditableArray |
setUuid(String name,
UUID uuid)
Set the value for the field at the given index to be a UUID . |
EditableArray |
setValue(int index,
Object value)
Set the value for the field with the given name to the supplied value. |
Methods inherited from interface org.infinispan.schematic.document.EditableDocument |
---|
getOrCreateArray, getOrCreateDocument, putAll, putAll, remove, removeAll, setArray, unwrap |
Methods inherited from interface org.infinispan.schematic.document.Array |
---|
clone, getEntries |
Methods inherited from interface org.infinispan.schematic.document.Document |
---|
containsAll, containsField, fields, get, getBinary, getBoolean, getBoolean, getCode, getCodeWithScope, getDouble, getDouble, getInteger, getInteger, getLong, getLong, getMaxKey, getMinKey, getNumber, getNumber, getObjectId, getPattern, getString, getString, getSymbol, getType, getUuid, getUuid, isEmpty, isNull, isNullOrMissing, keySet, size, toMap, with, with, withVariablesReplaced, withVariablesReplacedWithSystemProperties |
Methods inherited from interface java.util.List |
---|
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArray |
Method Detail |
---|
EditableArray set(String name, Object value)
set
in interface EditableDocument
name
- The name of the fieldvalue
- the new value for the field
EditableArray setValue(int index, Object value)
index
- The index in the arrayvalue
- the new value
EditableArray addValue(int index, Object value)
index
- The index in the arrayvalue
- the new value
EditableArray addValue(Object value)
value
- the new value
EditableDocument addValueIfAbsent(Object value)
value
- the value
EditableArray setBoolean(String name, boolean value)
setBoolean
in interface EditableDocument
name
- The name of the field, which is the string representation of the index in the arrayvalue
- the new value for the field
EditableArray setNumber(String name, int value)
setNumber
in interface EditableDocument
name
- The name of the field, which is the string representation of the index in the arrayvalue
- the new value for the field
EditableArray setNumber(String name, long value)
setNumber
in interface EditableDocument
name
- The name of the field, which is the string representation of the index in the arrayvalue
- the new value for the field
EditableArray setNumber(String name, float value)
setNumber
in interface EditableDocument
name
- The name of the field, which is the string representation of the index in the arrayvalue
- the new value for the field
EditableArray setNumber(String name, double value)
setNumber
in interface EditableDocument
name
- The name of the field, which is the string representation of the index in the arrayvalue
- the new value for the field
EditableArray setString(String name, String value)
setString
in interface EditableDocument
name
- The name of the field, which is the string representation of the index in the arrayvalue
- the new value for the field
EditableArray setSymbol(String name, String value)
Symbol
created from the supplied string value. Symbols are
defined in the BSON specification as being similar to a string but which exists for those languages that have a specific
symbol type. Symbols are serialized to JSON as a normal string.
setSymbol
in interface EditableDocument
name
- The name of the field, which is the string representation of the index in the arrayvalue
- the new value for the field
setString(String, String)
EditableDocument setDocument(String name)
setDocument
in interface EditableDocument
name
- The name of the field, which is the string representation of the index in the array
EditableDocument setDocument(String name, Document document)
setDocument
in interface EditableDocument
name
- The name of the field, which is the string representation of the index in the arraydocument
- the document
document
.EditableDocument getDocument(String name)
getDocument
in interface Document
getDocument
in interface EditableDocument
name
- The name of the field, which is the string representation of the index in the array
EditableArray setArray(String name)
setArray
in interface EditableDocument
name
- The name of the field, which is the string representation of the index in the array
EditableArray setArray(String name, Array array)
setArray
in interface EditableDocument
name
- The name of the field, which is the string representation of the index in the arrayarray
- the array
array
.EditableArray getArray(String name)
getArray
in interface Document
getArray
in interface EditableDocument
name
- The name of the field, which is the string representation of the index in the array
EditableArray setDate(String name, Date value)
setDate
in interface EditableDocument
name
- The name of the field, which is the string representation of the index in the arrayvalue
- the new value for the field
EditableArray setDate(String name, String isoDate) throws ParseException
yyyy-MM-ddTHH:mm:ss
" where "T
" is a literal
characteryyyy-MM-ddTHH:mm:ssZ
" where "T
" and "
Z
" are literal charactersyyyy-MM-ddTHH:mm:ssGMT+00:00
" where "
T
", and "GMT
" are literal characters
setDate
in interface EditableDocument
name
- The name of the field, which is the string representation of the index in the arrayisoDate
- the new value for the field
ParseException
- if the supplied value could not be parsed into a valid dateEditableArray setTimestamp(String name, int timeInSeconds, int increment)
Timestamp
with the supplied time in seconds and increment. Note
that Date
values are recommended for most purposes, as they are better suited to most applications' representations
of time instants.
setTimestamp
in interface EditableDocument
name
- The name of the field, which is the string representation of the index in the arraytimeInSeconds
- the time in seconds for the new Timestampincrement
- the time increment for the new Timestamp
setDate(String, Date)
EditableArray setObjectId(String name, String hex)
ObjectId
created from the supplied hexadecimal binary value.
Object IDs are defined by the BSON specification as 12-byte binary values designed to have a reasonably high probability of
being unique when allocated. Since there is no explicit way to represent these in a JSON document, each ObjectId value is
serialized in a JSON document as a nested document of the form:
{ "$oid" : "12bytesOfIdInBase16" }When nested documents of this form are read by this library's
JSON reader
, nested documents of this form will
be converted to an ObjectId value.
For example, an ObjectId with time value of "1310745823", machine value of "1", process value of "2", and increment value of "3" would be written as
{ "$oid" : "4e2064df0000010002000003" }
setObjectId
in interface EditableDocument
name
- The name of the field, which is the string representation of the index in the arrayhex
- the hexadecimal binary value for the ObjectId
setObjectId(String, byte[])
,
setObjectId(String, int, int, int, int)
EditableArray setObjectId(String name, byte[] bytes)
ObjectId
created from the supplied 12-byte binary value.
Object IDs are defined by the BSON specification as 12-byte binary values designed to have a reasonably high probability of
being unique when allocated. Since there is no explicit way to represent these in a JSON document, each ObjectId value is
serialized in a JSON document as a nested document of the form:
{ "$oid" : "12bytesOfIdInBase16" }When nested documents of this form are read by this library's
JSON reader
, nested documents of this form will
be converted to an ObjectId value.
For example, an ObjectId with time value of "1310745823", machine value of "1", process value of "2", and increment value of "3" would be written as
{ "$oid" : "4e2064df0000010002000003" }
setObjectId
in interface EditableDocument
name
- The name of the field, which is the string representation of the index in the arraybytes
- the 12-byte value for the ObjectId
setObjectId(String, String)
,
setObjectId(String, int, int, int, int)
EditableArray setObjectId(String name, int time, int machine, int process, int inc)
ObjectId
created from the supplied hexadecimal binary value.
Object IDs are defined by the BSON specification as 12-byte binary values designed to have a reasonably high probability of
being unique when allocated. Since there is no explicit way to represent these in a JSON document, each ObjectId value is
serialized in a JSON document as a nested document of the form:
{ "$oid" : "12bytesOfIdInBase16" }When nested documents of this form are read by this library's
JSON reader
, nested documents of this form will
be converted to an ObjectId value.
For example, an ObjectId with time value of "1310745823", machine value of "1", process value of "2", and increment value of "3" would be written as
{ "$oid" : "4e2064df0000010002000003" }
setObjectId
in interface EditableDocument
name
- The name of the field, which is the string representation of the index in the arraytime
- the Unix-style timestamp, which is a signed integer representing the number of seconds before or after January
1st 1970 (UTC)machine
- the first three bytes of the (md5) hash of the machine host name, or of the mac/network address, or the
virtual machine idprocess
- the 2 bytes of the process id (or thread id) of the process generating the object idinc
- an ever incrementing value, or a random number if a counter can't be used in the language/runtime
setObjectId(String, String)
,
setObjectId(String, byte[])
EditableArray setRegularExpression(String name, String pattern)
Pattern
instances, and are stored natively in BSON as regular expressions. However,
when serialized to JSON, regular expressions are written as nested documents of the form:
{ "$regex" : "pattern" }where "pattern" is the regular expression pattern.
When nested documents of this form are read by this library's JSON reader
, nested documents of this form will
be converted to a regular expression value.
setRegularExpression
in interface EditableDocument
name
- The name of the field, which is the string representation of the index in the arraypattern
- the regular expression pattern string
setRegularExpression(String, String, int)
EditableArray setRegularExpression(String name, String pattern, int flags)
Pattern
instances, and are stored natively in BSON as regular expressions. However,
when serialized to JSON, regular expressions are written as nested documents of the form:
{ "$regex" : "pattern", "$options" : "flags" }where "pattern" is the regular expression pattern, and "flags" is a string representation of the regular expression options.
When nested documents of this form are read by this library's JSON reader
, nested documents of this form will
be converted to a regular expression value.
setRegularExpression
in interface EditableDocument
name
- The name of the field, which is the string representation of the index in the arraypattern
- the regular expression pattern stringflags
- the bitwise-anded Pattern
options: Pattern.CANON_EQ
, Pattern.CASE_INSENSITIVE
,
Pattern.CASE_INSENSITIVE
, Pattern.COMMENTS
, Pattern.DOTALL
, Pattern.LITERAL
,
Pattern.MULTILINE
, Pattern.UNICODE_CASE
, and Pattern.UNIX_LINES
setRegularExpression(String, String)
EditableArray setNull(String name)
Null
is used for the value in the in-memory representation. The Document.isNull(String)
methods can be used to
determine if a field has been set to null, or Document.isNullOrMissing(String)
if the field has not be set or if it has
been set to null.
setNull
in interface EditableDocument
name
- The name of the field, which is the string representation of the index in the array
Document.isNull(String)
,
Document.isNullOrMissing(String)
EditableArray setBinary(String name, byte type, byte[] data)
{ "$type" : typeAsInt, "$base64" : "bytesInBase64" }where "typeAsInt" is the integer representation of the
BSON type
, and "bytesInBase64" is
the Base64 encoding of the actual Binary bytes
.
When nested documents of this form are read by this library's JSON reader
, nested documents of this form will
be converted to Binary value.
setBinary
in interface EditableDocument
name
- The name of the field, which is the string representation of the index in the arraytype
- one of the BSON type
constants denoting the type of the Binary
valuedata
- the bytes for the Binary
value
EditableArray setUuid(String name, UUID uuid)
UUID
. JSON does not formally support binary values, and so
such values will be encoded using a nested document of the form:
{ "$uuid" : "string-form-of-uuid" }where "string-form-of-uuid" is the UUID's
string representation
When nested documents of this form are read by this library's JSON reader
, nested documents of this form will
be converted to UUID value.
setUuid
in interface EditableDocument
name
- The name of the field, which is the string representation of the index in the arrayuuid
- the UUID value
EditableDocument setCode(String name, String code, boolean includeScope)
Code
or CodeWithScope
. JSON does not formally
support such values, and so when written to JSON they will be encoded using a nested document of the form:
{ "$code" : "code" }or, if there is a scope document
{ "$code" : "code", "$scope" : scope document }where "code" is the
Code
's JavaScript code
and scopeDocument is the nested
document representing the scope
in which the JavaScript code should be evaluated.
When nested documents of this form are read by this library's JSON reader
, nested documents of this form will
be converted to Code
or CodeWithScope
value.
Note that when includeScope
is true
, the returned EditableArray
can be used to populate
the scope document.
setCode
in interface EditableDocument
name
- The name of the field, which is the string representation of the index in the arraycode
- the codeincludeScope
- true if the code should include a scope (and if this method should return an EditableArray
for
this scope document), or false otherwise
includeScope
is true
, then the EditableDocument
for the scope; otherwise, this
array to allow for chaining methodssetCode(String, String, Document)
EditableDocument setCode(String name, String code, Document scope)
Code
or CodeWithScope
. JSON does not formally
support such values, and so when written to JSON they will be encoded using a nested document of the form:
{ "$code" : "code" }or, if there is a scope document
{ "$code" : "code", "$scope" : scope document }where "code" is the
Code
's JavaScript code
and scopeDocument is the nested
document representing the scope
in which the JavaScript code should be evaluated.
When nested documents of this form are read by this library's JSON reader
, nested documents of this form will
be converted to Code
or CodeWithScope
value.
setCode
in interface EditableDocument
name
- The name of the field, which is the string representation of the index in the arraycode
- the codescope
- the scope in which the JavaScript code should be evaulated, or null if there is no scope
EditableDocument
for the scopesetCode(String, String, boolean)
EditableArray setBoolean(int index, boolean value)
index
- The index in the array at which the value is to be setvalue
- the new value for the field
EditableArray setNumber(int index, int value)
index
- The index in the array at which the value is to be setvalue
- the new value for the field
EditableArray setNumber(int index, long value)
index
- The index in the array at which the value is to be setvalue
- the new value for the field
EditableArray setNumber(int index, float value)
index
- The index in the array at which the value is to be setvalue
- the new value for the field
EditableArray setNumber(int index, double value)
index
- The index in the array at which the value is to be setvalue
- the new value for the field
EditableArray setString(int index, String value)
index
- The index in the array at which the value is to be setvalue
- the new value for the field
EditableArray setSymbol(int index, String value)
Symbol
created from the supplied string value. Symbols are
defined in the BSON specification as being similar to a string but which exists for those languages that have a specific
symbol type. Symbols are serialized to JSON as a normal string.
index
- The index in the array at which the value is to be setvalue
- the new value for the field
setString(int, String)
EditableDocument setDocument(int index)
index
- The index in the array at which the value is to be set
EditableDocument setDocument(int index, Document document)
index
- The index in the array at which the value is to be setdocument
- the document
document
.EditableArray setArray(int index)
index
- The index in the array at which the value is to be set
EditableArray setArray(int index, Array array)
index
- The index in the array at which the value is to be setarray
- the array
array
.EditableArray setDate(int index, Date value)
index
- The index in the array at which the value is to be setvalue
- the new value for the field
EditableArray setDate(int index, String isoDate) throws ParseException
yyyy-MM-ddTHH:mm:ss
" where "T
" is a literal
characteryyyy-MM-ddTHH:mm:ssZ
" where "T
" and "
Z
" are literal charactersyyyy-MM-ddTHH:mm:ssGMT+00:00
" where "
T
", and "GMT
" are literal characters
index
- The index in the array at which the value is to be setisoDate
- the new value for the field
ParseException
- if the supplied value could not be parsed into a valid dateEditableArray setTimestamp(int index, int timeInSeconds, int increment)
Timestamp
with the supplied time in seconds and increment. Note
that Date
values are recommended for most purposes, as they are better suited to most applications' representations
of time instants.
index
- The index in the array at which the value is to be settimeInSeconds
- the time in seconds for the new Timestampincrement
- the time increment for the new Timestamp
setDate(int, Date)
EditableArray setObjectId(int index, String hex)
ObjectId
created from the supplied hexadecimal binary value.
Object IDs are defined by the BSON specification as 12-byte binary values designed to have a reasonably high probability of
being unique when allocated. Since there is no explicit way to represent these in a JSON document, each ObjectId value is
serialized in a JSON document as a nested document of the form:
{ "$oid" : "12bytesOfIdInBase16" }When nested documents of this form are read by this library's
JSON reader
, nested documents of this form will
be converted to an ObjectId value.
For example, an ObjectId with time value of "1310745823", machine value of "1", process value of "2", and increment value of "3" would be written as
{ "$oid" : "4e2064df0000010002000003" }
index
- The index in the array at which the value is to be sethex
- the hexadecimal binary value for the ObjectId
setObjectId(int, byte[])
,
setObjectId(int, int, int, int, int)
EditableArray setObjectId(int index, byte[] bytes)
ObjectId
created from the supplied 12-byte binary value.
Object IDs are defined by the BSON specification as 12-byte binary values designed to have a reasonably high probability of
being unique when allocated. Since there is no explicit way to represent these in a JSON document, each ObjectId value is
serialized in a JSON document as a nested document of the form:
{ "$oid" : "12bytesOfIdInBase16" }When nested documents of this form are read by this library's
JSON reader
, nested documents of this form will
be converted to an ObjectId value.
For example, an ObjectId with time value of "1310745823", machine value of "1", process value of "2", and increment value of "3" would be written as
{ "$oid" : "4e2064df0000010002000003" }
index
- The index in the array at which the value is to be setbytes
- the 12-byte value for the ObjectId
setObjectId(int, String)
,
setObjectId(int, int, int, int, int)
EditableArray setObjectId(int index, int time, int machine, int process, int inc)
ObjectId
created from the supplied hexadecimal binary value.
Object IDs are defined by the BSON specification as 12-byte binary values designed to have a reasonably high probability of
being unique when allocated. Since there is no explicit way to represent these in a JSON document, each ObjectId value is
serialized in a JSON document as a nested document of the form:
{ "$oid" : "12bytesOfIdInBase16" }When nested documents of this form are read by this library's
JSON reader
, nested documents of this form will
be converted to an ObjectId value.
For example, an ObjectId with time value of "1310745823", machine value of "1", process value of "2", and increment value of "3" would be written as
{ "$oid" : "4e2064df0000010002000003" }
index
- The index in the array at which the value is to be settime
- the Unix-style timestamp, which is a signed integer representing the number of seconds before or after January
1st 1970 (UTC)machine
- the first three bytes of the (md5) hash of the machine host name, or of the mac/network address, or the
virtual machine idprocess
- the 2 bytes of the process id (or thread id) of the process generating the object idinc
- an ever incrementing value, or a random number if a counter can't be used in the language/runtime
setObjectId(int, String)
,
setObjectId(int, byte[])
EditableArray setRegularExpression(int index, String pattern)
Pattern
instances, and are stored natively in BSON as regular expressions. However,
when serialized to JSON, regular expressions are written as nested documents of the form:
{ "$regex" : "pattern" }where "pattern" is the regular expression pattern.
When nested documents of this form are read by this library's JSON reader
, nested documents of this form will
be converted to a regular expression value.
index
- The index in the array at which the value is to be setpattern
- the regular expression pattern string
setRegularExpression(int, String, int)
EditableArray setRegularExpression(int index, String pattern, int flags)
Pattern
instances, and are stored natively in BSON as regular expressions. However,
when serialized to JSON, regular expressions are written as nested documents of the form:
{ "$regex" : "pattern", "$options" : "flags" }where "pattern" is the regular expression pattern, and "flags" is a string representation of the regular expression options.
When nested documents of this form are read by this library's JSON reader
, nested documents of this form will
be converted to a regular expression value.
index
- The index in the array at which the value is to be setpattern
- the regular expression pattern stringflags
- the bitwise-anded Pattern
options: Pattern.CANON_EQ
, Pattern.CASE_INSENSITIVE
,
Pattern.CASE_INSENSITIVE
, Pattern.COMMENTS
, Pattern.DOTALL
, Pattern.LITERAL
,
Pattern.MULTILINE
, Pattern.UNICODE_CASE
, and Pattern.UNIX_LINES
setRegularExpression(int, String)
EditableArray setNull(int index)
Null
is used for the value in the in-memory representation. The Document.isNull(String)
methods can be used to
determine if a field has been set to null, or Document.isNullOrMissing(String)
if the field has not be set or if it has
been set to null.
index
- The index in the array at which the value is to be set
Document.isNull(String)
,
Document.isNullOrMissing(String)
EditableArray setBinary(int index, byte type, byte[] data)
{ "$type" : typeAsInt, "$base64" : "bytesInBase64" }where "typeAsInt" is the integer representation of the
BSON type
, and "bytesInBase64" is
the Base64 encoding of the actual Binary bytes
.
When nested documents of this form are read by this library's JSON reader
, nested documents of this form will
be converted to Binary value.
index
- The index in the array at which the value is to be settype
- one of the BSON type
constants denoting the type of the Binary
valuedata
- the bytes for the Binary
value
EditableArray setUuid(int index, UUID uuid)
UUID
. JSON does not formally support binary values, and so
such values will be encoded using a nested document of the form:
{ "$uuid" : "string-form-of-uuid" }where "string-form-of-uuid" is the UUID's
string representation
When nested documents of this form are read by this library's JSON reader
, nested documents of this form will
be converted to UUID value.
index
- The index in the array at which the value is to be setuuid
- the UUID value
EditableDocument setCode(int index, String code, boolean includeScope)
Code
or CodeWithScope
. JSON does not formally
support such values, and so when written to JSON they will be encoded using a nested document of the form:
{ "$code" : "code" }or, if there is a scope document
{ "$code" : "code", "$scope" : scope document }where "code" is the
Code
's JavaScript code
and scopeDocument is the nested
document representing the scope
in which the JavaScript code should be evaluated.
When nested documents of this form are read by this library's JSON reader
, nested documents of this form will
be converted to Code
or CodeWithScope
value.
Note that when includeScope
is true
, the returned EditableArray
can be used to populate
the scope document.
index
- The index in the array at which the value is to be setcode
- the codeincludeScope
- true if the code should include a scope (and if this method should return an EditableArray
for
this scope document), or false otherwise
includeScope
is true
, then the EditableDocument
for the scope; otherwise, this
array to allow for chaining methodssetCode(int, String, Document)
EditableDocument setCode(int index, String code, Document scope)
Code
or CodeWithScope
. JSON does not formally
support such values, and so when written to JSON they will be encoded using a nested document of the form:
{ "$code" : "code" }or, if there is a scope document
{ "$code" : "code", "$scope" : scope document }where "code" is the
Code
's JavaScript code
and scopeDocument is the nested
document representing the scope
in which the JavaScript code should be evaluated.
When nested documents of this form are read by this library's JSON reader
, nested documents of this form will
be converted to Code
or CodeWithScope
value.
index
- The index in the array at which the value is to be setcode
- the codescope
- the scope in which the JavaScript code should be evaulated, or null if there is no scope
EditableDocument
for the scope; or this array if the scope is nullsetCode(int, String, boolean)
EditableArray addBoolean(int index, boolean value)
index
- The index in the array at which the value is to be setvalue
- the new value for the field
EditableArray addNumber(int index, int value)
index
- The index in the array at which the value is to be setvalue
- the new value for the field
EditableArray addNumber(int index, long value)
index
- The index in the array at which the value is to be setvalue
- the new value for the field
EditableArray addNumber(int index, float value)
index
- The index in the array at which the value is to be setvalue
- the new value for the field
EditableArray addNumber(int index, double value)
index
- The index in the array at which the value is to be setvalue
- the new value for the field
EditableArray addString(int index, String value)
index
- The index in the array at which the value is to be setvalue
- the new value for the field
EditableArray addSymbol(int index, String value)
Symbol
created from the supplied string value. Symbols are
defined in the BSON specification as being similar to a string but which exists for those languages that have a specific
symbol type. Symbols are serialized to JSON as a normal string.
index
- The index in the array at which the value is to be setvalue
- the new value for the field
setString(int, String)
EditableDocument addDocument(int index)
index
- The index in the array at which the value is to be set
EditableDocument addDocument(int index, Document document)
index
- The index in the array at which the value is to be setdocument
- the document
document
.EditableArray addArray(int index)
index
- The index in the array at which the value is to be set
EditableArray addArray(int index, Array array)
index
- The index in the array at which the value is to be setarray
- the array
array
.EditableArray addDate(int index, Date value)
index
- The index in the array at which the value is to be setvalue
- the new value for the field
EditableArray addDate(int index, String isoDate) throws ParseException
yyyy-MM-ddTHH:mm:ss
" where "T
" is a literal
characteryyyy-MM-ddTHH:mm:ssZ
" where "T
" and "
Z
" are literal charactersyyyy-MM-ddTHH:mm:ssGMT+00:00
" where "
T
", and "GMT
" are literal characters
index
- The index in the array at which the value is to be setisoDate
- the new value for the field
ParseException
- if the supplied value could not be parsed into a valid dateEditableArray addTimestamp(int index, int timeInSeconds, int increment)
Timestamp
with the supplied time in seconds and increment.
Note that Date
values are recommended for most purposes, as they are better suited to most applications'
representations of time instants.
index
- The index in the array at which the value is to be settimeInSeconds
- the time in seconds for the new Timestampincrement
- the time increment for the new Timestamp
setDate(int, Date)
EditableArray addObjectId(int index, String hex)
ObjectId
created from the supplied hexadecimal binary
value. Object IDs are defined by the BSON specification as 12-byte binary values designed to have a reasonably high
probability of being unique when allocated. Since there is no explicit way to represent these in a JSON document, each
ObjectId value is serialized in a JSON document as a nested document of the form:
{ "$oid" : "12bytesOfIdInBase16" }When nested documents of this form are read by this library's
JSON reader
, nested documents of this form will
be converted to an ObjectId value.
For example, an ObjectId with time value of "1310745823", machine value of "1", process value of "2", and increment value of "3" would be written as
{ "$oid" : "4e2064df0000010002000003" }
index
- The index in the array at which the value is to be sethex
- the hexadecimal binary value for the ObjectId
setObjectId(int, byte[])
,
setObjectId(int, int, int, int, int)
EditableArray addObjectId(int index, byte[] bytes)
ObjectId
created from the supplied 12-byte binary value.
Object IDs are defined by the BSON specification as 12-byte binary values designed to have a reasonably high probability of
being unique when allocated. Since there is no explicit way to represent these in a JSON document, each ObjectId value is
serialized in a JSON document as a nested document of the form:
{ "$oid" : "12bytesOfIdInBase16" }When nested documents of this form are read by this library's
JSON reader
, nested documents of this form will
be converted to an ObjectId value.
For example, an ObjectId with time value of "1310745823", machine value of "1", process value of "2", and increment value of "3" would be written as
{ "$oid" : "4e2064df0000010002000003" }
index
- The index in the array at which the value is to be setbytes
- the 12-byte value for the ObjectId
setObjectId(int, String)
,
setObjectId(int, int, int, int, int)
EditableArray addObjectId(int index, int time, int machine, int process, int inc)
ObjectId
created from the supplied hexadecimal binary
value. Object IDs are defined by the BSON specification as 12-byte binary values designed to have a reasonably high
probability of being unique when allocated. Since there is no explicit way to represent these in a JSON document, each
ObjectId value is serialized in a JSON document as a nested document of the form:
{ "$oid" : "12bytesOfIdInBase16" }When nested documents of this form are read by this library's
JSON reader
, nested documents of this form will
be converted to an ObjectId value.
For example, an ObjectId with time value of "1310745823", machine value of "1", process value of "2", and increment value of "3" would be written as
{ "$oid" : "4e2064df0000010002000003" }
index
- The index in the array at which the value is to be settime
- the Unix-style timestamp, which is a signed integer representing the number of seconds before or after January
1st 1970 (UTC)machine
- the first three bytes of the (md5) hash of the machine host name, or of the mac/network address, or the
virtual machine idprocess
- the 2 bytes of the process id (or thread id) of the process generating the object idinc
- an ever incrementing value, or a random number if a counter can't be used in the language/runtime
setObjectId(int, String)
,
setObjectId(int, byte[])
EditableArray addRegularExpression(int index, String pattern)
Pattern
instances, and are stored natively in BSON as regular expressions. However,
when serialized to JSON, regular expressions are written as nested documents of the form:
{ "$regex" : "pattern" }where "pattern" is the regular expression pattern.
When nested documents of this form are read by this library's JSON reader
, nested documents of this form will
be converted to a regular expression value.
index
- The index in the array at which the value is to be setpattern
- the regular expression pattern string
setRegularExpression(int, String, int)
EditableArray addRegularExpression(int index, String pattern, int flags)
Pattern
instances, and are stored natively in BSON as regular expressions. However,
when serialized to JSON, regular expressions are written as nested documents of the form:
{ "$regex" : "pattern", "$options" : "flags" }where "pattern" is the regular expression pattern, and "flags" is a string representation of the regular expression options.
When nested documents of this form are read by this library's JSON reader
, nested documents of this form will
be converted to a regular expression value.
index
- The index in the array at which the value is to be setpattern
- the regular expression pattern stringflags
- the bitwise-anded Pattern
options: Pattern.CANON_EQ
, Pattern.CASE_INSENSITIVE
,
Pattern.CASE_INSENSITIVE
, Pattern.COMMENTS
, Pattern.DOTALL
, Pattern.LITERAL
,
Pattern.MULTILINE
, Pattern.UNICODE_CASE
, and Pattern.UNIX_LINES
setRegularExpression(int, String)
EditableArray addNull(int index)
Null
is used for the value in the in-memory representation. The Document.isNull(String)
methods can be used to
determine if a field has been set to null, or Document.isNullOrMissing(String)
if the field has not be set or if it has
been set to null.
index
- The index in the array at which the value is to be set
Document.isNull(String)
,
Document.isNullOrMissing(String)
EditableArray addBinary(int index, byte type, byte[] data)
{ "$type" : typeAsInt, "$base64" : "bytesInBase64" }where "typeAsInt" is the integer representation of the
BSON type
, and "bytesInBase64" is
the Base64 encoding of the actual Binary bytes
.
When nested documents of this form are read by this library's JSON reader
, nested documents of this form will
be converted to Binary value.
index
- The index in the array at which the value is to be settype
- one of the BSON type
constants denoting the type of the Binary
valuedata
- the bytes for the Binary
value
EditableArray addUuid(int index, UUID uuid)
UUID
. JSON does not formally support binary values, and
so such values will be encoded using a nested document of the form:
{ "$uuid" : "string-form-of-uuid" }where "string-form-of-uuid" is the UUID's
string representation
When nested documents of this form are read by this library's JSON reader
, nested documents of this form will
be converted to UUID value.
index
- The index in the array at which the value is to be setuuid
- the UUID value
EditableDocument addCode(int index, String code, boolean includeScope)
Code
or CodeWithScope
. JSON does not formally
support such values, and so when written to JSON they will be encoded using a nested document of the form:
{ "$code" : "code" }or, if there is a scope document
{ "$code" : "code", "$scope" : scope document }where "code" is the
Code
's JavaScript code
and scopeDocument is the nested
document representing the scope
in which the JavaScript code should be evaluated.
When nested documents of this form are read by this library's JSON reader
, nested documents of this form will
be converted to Code
or CodeWithScope
value.
Note that when includeScope
is true
, the returned EditableArray
can be used to populate
the scope document.
index
- The index in the array at which the value is to be setcode
- the codeincludeScope
- true if the code should include a scope (and if this method should return an EditableArray
for
this scope document), or false otherwise
includeScope
is true
, then the EditableDocument
for the scope; otherwise, this
array to allow for chaining methodssetCode(int, String, Document)
EditableDocument addCode(int index, String code, Document scope)
Code
or CodeWithScope
. JSON does not formally
support such values, and so when written to JSON they will be encoded using a nested document of the form:
{ "$code" : "code" }or, if there is a scope document
{ "$code" : "code", "$scope" : scope document }where "code" is the
Code
's JavaScript code
and scopeDocument is the nested
document representing the scope
in which the JavaScript code should be evaluated.
When nested documents of this form are read by this library's JSON reader
, nested documents of this form will
be converted to Code
or CodeWithScope
value.
index
- The index in the array at which the value is to be setcode
- the codescope
- the scope in which the JavaScript code should be evaulated, or null if there is no scope
EditableDocument
for the scope; or this array if the scope is nullsetCode(int, String, boolean)
EditableArray addBoolean(boolean value)
value
- the new value for the field
EditableArray addNumber(int value)
value
- the new value for the field
EditableArray addNumber(long value)
value
- the new value for the field
EditableArray addNumber(float value)
value
- the new value for the field
EditableArray addNumber(double value)
value
- the new value for the field
EditableArray addString(String value)
value
- the new value for the field
EditableArray addSymbol(String value)
value
- the new value for the field
addString(String)
EditableDocument addDocument()
EditableDocument addDocument(Document document)
document
- the document
document
.EditableArray addArray()
EditableArray addArray(Array array)
array
- the array
array
.EditableArray addDate(Date value)
value
- the new value for the field
EditableArray addDate(String isoDate) throws ParseException
isoDate
- the new value for the field
ParseException
- if the supplied value could not be parsed into a valid dateaddDate(Date)
EditableArray addTimestamp(int timeInSeconds, int increment)
timeInSeconds
- the time in seconds for the new Timestampincrement
- the time increment for the new Timestamp
addDate(Date)
EditableArray addObjectId(String hex)
hex
- the hexadecimal binary value for the ObjectId
addObjectId(byte[])
,
addObjectId(int, int, int, int)
EditableArray addObjectId(byte[] bytes)
bytes
- the 12-byte value for the ObjectId
addObjectId(String)
,
addObjectId(int, int, int, int)
EditableArray addObjectId(int time, int machine, int process, int inc)
time
- the Unix-style timestamp, which is a signed integer representing the number of seconds before or after January
1st 1970 (UTC)machine
- the first three bytes of the (md5) hash of the machine host name, or of the mac/network address, or the
virtual machine idprocess
- the 2 bytes of the process id (or thread id) of the process generating the object idinc
- an ever incrementing value, or a random number if a counter can't be used in the language/runtime
addObjectId(String)
,
addObjectId(byte[])
EditableArray addRegularExpression(String pattern)
pattern
- the regular expression pattern string
EditableArray addRegularExpression(String pattern, int flags)
pattern
- the regular expression pattern stringflags
- the bitwise-anded Pattern
options: Pattern.CANON_EQ
, Pattern.CASE_INSENSITIVE
,
Pattern.CASE_INSENSITIVE
, Pattern.COMMENTS
, Pattern.DOTALL
, Pattern.LITERAL
,
Pattern.MULTILINE
, Pattern.UNICODE_CASE
, and Pattern.UNIX_LINES
EditableArray addNull()
Null
value.
Document.isNull(String)
,
Document.isNullOrMissing(String)
EditableArray addBinary(byte type, byte[] data)
Binary
value with the supplied type and content.
type
- one of the BSON type
constants denoting the type of the Binary
valuedata
- the bytes for the Binary
value
EditableArray addUuid(UUID uuid)
uuid
- the UUID value
EditableDocument addCode(String code, boolean includeScope)
Code
with the supplied JavaScript code.
code
- the codeincludeScope
- true if the code should include a scope (and if this method should return an EditableArray
for
this scope document), or false otherwise
includeScope
is true
, then the EditableArray
for the scope; otherwise, this
document to allow for chaining methodsaddCode(String, Document)
EditableDocument addCode(String code, Document scope)
CodeWithScope
with the supplied JavaScript code and scope.
code
- the codescope
- the scope in which the JavaScript code should be evaulated, or null if there is no scope
EditableDocument
for the scope, or null if the scope
reference is nulladdCode(String, boolean)
EditableArray addBooleanIfAbsent(boolean value)
value
- the new value for the field
EditableArray addNumberIfAbsent(int value)
value
- the new value for the field
EditableArray addNumberIfAbsent(long value)
value
- the new value for the field
EditableArray addNumberIfAbsent(float value)
value
- the new value for the field
EditableArray addNumberIfAbsent(double value)
value
- the new value for the field
EditableArray addStringIfAbsent(String value)
value
- the new value for the field
EditableArray addSymbolIfAbsent(String value)
value
- the new value for the field
addString(String)
EditableDocument addDocumentIfAbsent(Document document)
document
- the document
document
.EditableArray addArrayIfAbsent(Array array)
array
- the array
array
.EditableArray addDateIfAbsent(Date value)
value
- the new value for the field
EditableArray addDateIfAbsent(String isoDate) throws ParseException
isoDate
- the new value for the field
ParseException
- if the supplied value could not be parsed into a valid dateaddDate(Date)
EditableArray addTimestampIfAbsent(int timeInSeconds, int increment)
timeInSeconds
- the time in seconds for the new Timestampincrement
- the time increment for the new Timestamp
addDate(Date)
EditableArray addObjectIdIfAbsent(String hex)
hex
- the hexadecimal binary value for the ObjectId
addObjectId(byte[])
,
addObjectId(int, int, int, int)
EditableArray addObjectIdIfAbsent(byte[] bytes)
bytes
- the 12-byte value for the ObjectId
addObjectId(String)
,
addObjectId(int, int, int, int)
EditableArray addObjectIdIfAbsent(int time, int machine, int process, int inc)
time
- the Unix-style timestamp, which is a signed integer representing the number of seconds before or after January
1st 1970 (UTC)machine
- the first three bytes of the (md5) hash of the machine host name, or of the mac/network address, or the
virtual machine idprocess
- the 2 bytes of the process id (or thread id) of the process generating the object idinc
- an ever incrementing value, or a random number if a counter can't be used in the language/runtime
addObjectId(String)
,
addObjectId(byte[])
EditableArray addRegularExpressionIfAbsent(String pattern)
pattern
- the regular expression pattern string
EditableArray addRegularExpressionIfAbsent(String pattern, int flags)
pattern
- the regular expression pattern stringflags
- the bitwise-anded Pattern
options: Pattern.CANON_EQ
, Pattern.CASE_INSENSITIVE
,
Pattern.CASE_INSENSITIVE
, Pattern.COMMENTS
, Pattern.DOTALL
, Pattern.LITERAL
,
Pattern.MULTILINE
, Pattern.UNICODE_CASE
, and Pattern.UNIX_LINES
EditableArray addNullIfAbsent()
Null
value, if and only if there is not already a null value in the array.
Document.isNull(String)
,
Document.isNullOrMissing(String)
EditableArray addBinaryIfAbsent(byte type, byte[] data)
Binary
value with the supplied type and content, if and only if an equivalent value doesn't
already exist in the array.
type
- one of the BSON type
constants denoting the type of the Binary
valuedata
- the bytes for the Binary
value
EditableArray addUuidIfAbsent(UUID uuid)
uuid
- the UUID value
EditableDocument addCodeIfAbsent(String code, Document scope)
CodeWithScope
with the supplied JavaScript code and scope, if and only if an equivalent value
doesn't already exist in the array.
code
- the codescope
- the scope in which the JavaScript code should be evaulated, or null if there is no scope
EditableDocument
for the scope, or null if the scope
reference is nulladdCode(String, boolean)
|
ModeShape Distribution 3.0.0.Beta4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |