Package org.bson
Class BsonArray
- java.lang.Object
-
- org.bson.BsonValue
-
- org.bson.BsonArray
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int index, BsonValue element)booleanadd(BsonValue bsonValue)booleanaddAll(int index, Collection<? extends BsonValue> c)booleanaddAll(Collection<? extends BsonValue> c)voidclear()BsonArrayclone()booleancontains(Object o)booleancontainsAll(Collection<?> c)booleanequals(Object o)BsonValueget(int index)BsonTypegetBsonType()Gets the BSON type of this value.List<BsonValue>getValues()Gets the values in this array as a list ofBsonValueobjects.inthashCode()intindexOf(Object o)booleanisEmpty()Iterator<BsonValue>iterator()intlastIndexOf(Object o)ListIterator<BsonValue>listIterator()ListIterator<BsonValue>listIterator(int index)static BsonArrayparse(String json)Parses a string in MongoDB Extended JSON format to aBsonArrayBsonValueremove(int index)booleanremove(Object o)booleanremoveAll(Collection<?> c)booleanretainAll(Collection<?> c)BsonValueset(int index, BsonValue element)intsize()List<BsonValue>subList(int fromIndex, int toIndex)Object[]toArray()<T> T[]toArray(T[] a)StringtoString()-
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
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream
-
-
-
-
Method Detail
-
parse
public static BsonArray parse(String json)
Parses a string in MongoDB Extended JSON format to aBsonArray- Parameters:
json- the JSON string- Returns:
- a corresponding
BsonArrayobject - Since:
- 3.4
- See Also:
JsonReader- MongoDB documentation
- MongoDB Extended JSON
-
getValues
public List<BsonValue> getValues()
Gets the values in this array as a list ofBsonValueobjects.- Returns:
- the values in this array.
-
getBsonType
public BsonType getBsonType()
Description copied from class:BsonValueGets the BSON type of this value.- Specified by:
getBsonTypein classBsonValue- Returns:
- the BSON type, which may not be null (but may be BSONType.NULL)
-
size
public int size()
-
isEmpty
public boolean isEmpty()
-
contains
public boolean contains(Object o)
-
toArray
public Object[] toArray()
-
toArray
public <T> T[] toArray(T[] a)
-
add
public boolean add(BsonValue bsonValue)
-
remove
public boolean remove(Object o)
-
containsAll
public boolean containsAll(Collection<?> c)
- Specified by:
containsAllin interfaceCollection<BsonValue>- Specified by:
containsAllin interfaceList<BsonValue>
-
addAll
public boolean addAll(Collection<? extends BsonValue> c)
-
addAll
public boolean addAll(int index, Collection<? extends BsonValue> c)
-
removeAll
public boolean removeAll(Collection<?> c)
-
retainAll
public boolean retainAll(Collection<?> c)
-
clear
public void clear()
-
lastIndexOf
public int lastIndexOf(Object o)
- Specified by:
lastIndexOfin interfaceList<BsonValue>
-
listIterator
public ListIterator<BsonValue> listIterator()
- Specified by:
listIteratorin interfaceList<BsonValue>
-
listIterator
public ListIterator<BsonValue> listIterator(int index)
- Specified by:
listIteratorin interfaceList<BsonValue>
-
equals
public boolean equals(Object o)
-
hashCode
public int hashCode()
-
-