Package org.bson
Class RawBsonArray
- java.lang.Object
-
- org.bson.BsonValue
-
- org.bson.BsonArray
-
- org.bson.RawBsonArray
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.lang.Iterable<BsonValue>
,java.util.Collection<BsonValue>
,java.util.List<BsonValue>
public class RawBsonArray extends BsonArray implements java.io.Serializable
An immutable BSON array that is represented using only the raw bytes.- Since:
- 3.7
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description RawBsonArray(byte[] bytes)
Constructs a new instance with the given byte array.RawBsonArray(byte[] bytes, int offset, int length)
Constructs a new instance with the given byte array, offset, and length.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(int index, BsonValue element)
boolean
add(BsonValue bsonValue)
boolean
addAll(int index, java.util.Collection<? extends BsonValue> c)
boolean
addAll(java.util.Collection<? extends BsonValue> c)
void
clear()
BsonArray
clone()
boolean
equals(java.lang.Object o)
int
hashCode()
BsonValue
remove(int index)
boolean
remove(java.lang.Object o)
boolean
removeAll(java.util.Collection<?> c)
boolean
retainAll(java.util.Collection<?> c)
BsonValue
set(int index, BsonValue element)
-
Methods inherited from class org.bson.BsonArray
contains, containsAll, get, getBsonType, getValues, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, parse, size, subList, toArray, toArray, toString
-
Methods inherited from class org.bson.BsonValue
asArray, asBinary, asBoolean, asDateTime, asDBPointer, asDecimal128, asDocument, asDouble, asInt32, asInt64, asJavaScript, asJavaScriptWithScope, asNumber, asObjectId, asRegularExpression, asString, asSymbol, asTimestamp, isArray, isBinary, isBoolean, isDateTime, isDBPointer, isDecimal128, isDocument, isDouble, isInt32, isInt64, isJavaScript, isJavaScriptWithScope, isNull, isNumber, isObjectId, isRegularExpression, isString, isSymbol, isTimestamp
-
-
-
-
Constructor Detail
-
RawBsonArray
public RawBsonArray(byte[] bytes)
Constructs a new instance with the given byte array. Note that it does not make a copy of the array, so do not modify it after passing it to this constructor.- Parameters:
bytes
- the bytes representing a BSON document. Note that the byte array is NOT copied, so care must be taken not to modify it after passing it to this construction, unless of course that is your intention.
-
RawBsonArray
public RawBsonArray(byte[] bytes, int offset, int length)
Constructs a new instance with the given byte array, offset, and length. Note that it does not make a copy of the array, so do not modify it after passing it to this constructor.- Parameters:
bytes
- the bytes representing a BSON document. Note that the byte array is NOT copied, so care must be taken not to modify it after passing it to this construction, unless of course that is your intention.offset
- the offset into the byte arraylength
- the length of the subarray to use
-
-
Method Detail
-
add
public boolean add(BsonValue bsonValue)
-
remove
public boolean remove(java.lang.Object o)
-
addAll
public boolean addAll(java.util.Collection<? extends BsonValue> c)
-
addAll
public boolean addAll(int index, java.util.Collection<? extends BsonValue> c)
-
removeAll
public boolean removeAll(java.util.Collection<?> c)
-
retainAll
public boolean retainAll(java.util.Collection<?> c)
-
clear
public void clear()
-
add
public void add(int index, BsonValue element)
-
remove
public BsonValue remove(int index)
-
equals
public boolean equals(java.lang.Object o)
-
-