Class CouchbaseArraySet<T>
java.lang.Object
java.util.AbstractCollection<T>
java.util.AbstractSet<T>
com.couchbase.client.java.datastructures.CouchbaseArraySet<T>
- Type Parameters:
T- the type of values in the set.
- All Implemented Interfaces:
Iterable<T>,Collection<T>,Set<T>
A CouchbaseArraySet is a
Set backed by a Couchbase document (more
specifically a JSON array).
Note that a CouchbaseArraySet is restricted to primitive types (the types that a JSON array
can contain, except JsonObject and JsonArray). null entries are supported.- Since:
- 2.3.6
-
Constructor Summary
ConstructorsConstructorDescriptionCouchbaseArraySet(String id, Collection collection, Class<T> entityType, ArraySetOptions options) Create a newCouchbaseArraySet, backed by the document identified byidin the given Couchbasebucket. -
Method Summary
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAllMethods inherited from class java.util.AbstractCollection
addAll, containsAll, retainAll, toArray, toArray, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, streamMethods inherited from interface java.util.Set
addAll, containsAll, retainAll, spliterator, toArray, toArray
-
Constructor Details
-
CouchbaseArraySet
public CouchbaseArraySet(String id, Collection collection, Class<T> entityType, ArraySetOptions options) Create a newCouchbaseArraySet, backed by the document identified byidin the given Couchbasebucket. Note that if the document already exists, its content will be used as initial content for this collection. Otherwise it is created empty.- Parameters:
id- the id of the Couchbase document to back the set.collection- theCollectionthrough which to interact with the document.entityType- a Class describing the type of objects in this Set.options- aArraySetOptionsto use for all operations on this instance of the list.
-
-
Method Details
-
size
public int size()- Specified by:
sizein interfaceCollection<T>- Specified by:
sizein interfaceSet<T>- Specified by:
sizein classAbstractCollection<T>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection<T>- Specified by:
isEmptyin interfaceSet<T>- Overrides:
isEmptyin classAbstractCollection<T>
-
contains
- Specified by:
containsin interfaceCollection<T>- Specified by:
containsin interfaceSet<T>- Overrides:
containsin classAbstractCollection<T>
-
iterator
-
add
- Specified by:
addin interfaceCollection<T>- Specified by:
addin interfaceSet<T>- Overrides:
addin classAbstractCollection<T>
-
remove
- Specified by:
removein interfaceCollection<T>- Specified by:
removein interfaceSet<T>- Overrides:
removein classAbstractCollection<T>
-
clear
public void clear()- Specified by:
clearin interfaceCollection<T>- Specified by:
clearin interfaceSet<T>- Overrides:
clearin classAbstractCollection<T>
-