public interface ArrayBuilder extends Builder
Modifier and Type | Method and Description |
---|---|
ArrayBuilder |
add(boolean value)
Adds a boolean element.
|
ArrayBuilder |
add(byte[] data)
Adds a binary element using sub-type zero (the default).
|
ArrayBuilder |
add(byte subType,
byte[] data)
Adds a binary element.
|
ArrayBuilder |
add(Date timestamp)
Adds a timestamp element.
|
ArrayBuilder |
add(DocumentAssignable document)
Adds a pre-constructed document to the array.
|
ArrayBuilder |
add(double value)
Adds a double element.
|
ArrayBuilder |
add(ElementAssignable element)
Adds a pre-built element to the document.
|
ArrayBuilder |
add(int value)
Adds a integer (32-bit signed) element.
|
ArrayBuilder |
add(long value)
Adds a long (64-bit signed) element.
|
ArrayBuilder |
add(ObjectId id)
Adds an ObjectId element.
|
ArrayBuilder |
add(Pattern pattern)
Adds an ObjectId element.
|
ArrayBuilder |
add(String value)
Adds a string element.
|
ArrayBuilder |
add(String databaseName,
String collectionName,
ObjectId id)
Deprecated.
See BSON specification.
|
ArrayBuilder |
addBinary(byte[] data)
Adds a binary element using sub-type zero (the default).
|
ArrayBuilder |
addBinary(byte subType,
byte[] data)
Adds a binary element.
|
ArrayBuilder |
addBoolean(boolean value)
Adds a boolean element.
|
ArrayBuilder |
addDBPointer(String databaseName,
String collectionName,
ObjectId id)
Deprecated.
See BSON specification.
|
ArrayBuilder |
addDocument(DocumentAssignable document)
Adds a pre-constructed document to the array.
|
ArrayBuilder |
addDouble(double value)
Adds a double element.
|
ArrayBuilder |
addInteger(int value)
Adds a integer (32-bit signed) element.
|
ArrayBuilder |
addJavaScript(String code)
Adds a JavaScript element.
|
ArrayBuilder |
addJavaScript(String code,
DocumentAssignable scope)
Adds a JavaScript with Scope element.
|
ArrayBuilder |
addLong(long value)
Adds a long (64-bit signed) element.
|
ArrayBuilder |
addMaxKey()
Adds a minimum key value element.
|
ArrayBuilder |
addMinKey()
Adds a minimum key value element.
|
ArrayBuilder |
addMongoTimestamp(long value)
Adds a MongoDB Timestamp element.
|
ArrayBuilder |
addNull()
Adds a
null valued element. |
ArrayBuilder |
addObjectId(ObjectId id)
Adds an ObjectId element.
|
ArrayBuilder |
addRegularExpression(Pattern pattern)
Adds a regular expression element.
|
ArrayBuilder |
addRegularExpression(String pattern,
String options)
Adds a regular expression element.
|
ArrayBuilder |
addString(String value)
Adds a string element.
|
ArrayBuilder |
addSymbol(String symbol)
Adds a symbol element.
|
ArrayBuilder |
addTimestamp(long timestamp)
Adds a timestamp element.
|
Element[] |
build()
Returns the array of
Element s being constructed. |
DocumentBuilder |
push()
Pushes a context for constructing a sub-document.
|
ArrayBuilder |
pushArray()
Pushes a context for constructing a sub-array.
|
ArrayBuilder |
reset()
Resets the builder back to an empty state.
|
ArrayBuilder add(boolean value)
This is a equivalent to addBoolean(boolean)
but less verbose.
value
- The boolean value.ArrayBuilder
for method chaining.ArrayBuilder add(byte subType, byte[] data)
This is a equivalent to addBinary(byte, byte[])
but less
verbose.
subType
- The sub-type for the binary data.data
- The binary value.ArrayBuilder
for method chaining.ArrayBuilder add(byte[] data)
This is a equivalent to addBinary(byte[])
but less verbose.
data
- The binary value.ArrayBuilder
for method chaining.ArrayBuilder add(Date timestamp)
This is a equivalent to addTimeStamp(timestamp.getTime())
but less verbose.
timestamp
- The number of milliseconds since the Unix epoch.ArrayBuilder
for method chaining.ArrayBuilder add(DocumentAssignable document)
This is a equivalent to addDocument(DocumentAssignable)
but less
verbose.
document
- The document to add to the array.ArrayBuilder
for method chaining.ArrayBuilder add(double value)
This is a equivalent to addDouble(double)
but less verbose.
value
- The double value.ArrayBuilder
for method chaining.ArrayBuilder add(ElementAssignable element)
element
- The element to add.ArrayBuilder
for method chaining.ArrayBuilder add(int value)
This is a equivalent to addInteger(int)
but less verbose.
value
- The integer value.ArrayBuilder
for method chaining.ArrayBuilder add(long value)
This is a equivalent to addLong(long)
but less verbose.
value
- The long value.ArrayBuilder
for method chaining.ArrayBuilder add(ObjectId id)
This is a equivalent to addObjectId(ObjectId)
but less verbose.
id
- The ObjectId to add.ArrayBuilder
for method chaining.ArrayBuilder add(Pattern pattern)
This is a equivalent to addRegularExpression(Pattern)
but less
verbose.
pattern
- The pattern for the regular expression.ArrayBuilder
for method chaining.ArrayBuilder add(String value)
This is a equivalent to addString(String)
but less verbose.
value
- The string value.ArrayBuilder
for method chaining.@Deprecated ArrayBuilder add(String databaseName, String collectionName, ObjectId id)
This is a equivalent to addDBPointer(String, String, ObjectId)
but less verbose.
databaseName
- The name of the database containing the document.collectionName
- The name of the collection containing the document.id
- The id for the document.ArrayBuilder
for method chaining.ArrayBuilder addBinary(byte subType, byte[] data)
subType
- The sub-type for the binary data.data
- The binary value.ArrayBuilder
for method chaining.ArrayBuilder addBinary(byte[] data)
data
- The binary value.ArrayBuilder
for method chaining.ArrayBuilder addBoolean(boolean value)
value
- The boolean value.ArrayBuilder
for method chaining.@Deprecated ArrayBuilder addDBPointer(String databaseName, String collectionName, ObjectId id)
databaseName
- The name of the database containing the document.collectionName
- The name of the collection containing the document.id
- The id for the document.ArrayBuilder
for method chaining.ArrayBuilder addDocument(DocumentAssignable document)
document
- The document to add to the array.ArrayBuilder
for method chaining.ArrayBuilder addDouble(double value)
value
- The double value.ArrayBuilder
for method chaining.ArrayBuilder addInteger(int value)
value
- The integer value.ArrayBuilder
for method chaining.ArrayBuilder addJavaScript(String code)
code
- The java script code.ArrayBuilder
for method chaining.ArrayBuilder addJavaScript(String code, DocumentAssignable scope)
code
- The java script code.scope
- The scope for the JacaScript code.ArrayBuilder
for method chaining.ArrayBuilder addLong(long value)
value
- The long value.ArrayBuilder
for method chaining.ArrayBuilder addMaxKey()
ArrayBuilder
for method chaining.ArrayBuilder addMinKey()
ArrayBuilder
for method chaining.ArrayBuilder addMongoTimestamp(long value)
value
- The mongoDB timstamp value.ArrayBuilder
for method chaining.ArrayBuilder addNull()
null
valued element.ArrayBuilder
for method chaining.ArrayBuilder addObjectId(ObjectId id)
id
- The ObjectId to add.ArrayBuilder
for method chaining.ArrayBuilder addRegularExpression(Pattern pattern)
pattern
- The pattern for the regular expression.ArrayBuilder
for method chaining.ArrayBuilder addRegularExpression(String pattern, String options)
pattern
- The pattern for the regular expression.options
- The regular expression options. See the BSON specification for
details.ArrayBuilder
for method chaining.ArrayBuilder addString(String value)
value
- The string value.ArrayBuilder
for method chaining.ArrayBuilder addSymbol(String symbol)
symbol
- The symbol value.ArrayBuilder
for method chaining.ArrayBuilder addTimestamp(long timestamp)
timestamp
- The number of milliseconds since the Unix epoch.ArrayBuilder
for method chaining.Element[] build()
Element
s being constructed.Element
.DocumentBuilder push()
ArrayBuilder
for method chaining.ArrayBuilder pushArray()
ArrayBuilder
for method chaining.ArrayBuilder reset()
Overridden to return an ArrayBuilder
instance.
Copyright © 2011-2012 Allanbank Consulting, Inc.. All Rights Reserved.