T
- the type of values in the set.@Stability.Committed public class CouchbaseArraySet<T> extends AbstractSet<T>
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.Constructor and Description |
---|
CouchbaseArraySet(String id,
Collection collection,
Class<T> entityType,
ArraySetOptions options)
Create a new
CouchbaseArraySet , backed by the document identified by id
in the given Couchbase bucket . |
Modifier and Type | Method and Description |
---|---|
boolean |
add(T t) |
void |
clear() |
boolean |
contains(Object t) |
boolean |
isEmpty() |
Iterator<T> |
iterator() |
boolean |
remove(Object t) |
int |
size() |
equals, hashCode, removeAll
addAll, containsAll, retainAll, toArray, toArray, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addAll, containsAll, retainAll, spliterator, toArray, toArray
parallelStream, removeIf, stream
public CouchbaseArraySet(String id, Collection collection, Class<T> entityType, ArraySetOptions options)
CouchbaseArraySet
, backed by the document identified by id
in the given Couchbase bucket
. Note that if the document already exists,
its content will be used as initial content for this collection. Otherwise it is created empty.id
- the id of the Couchbase document to back the set.collection
- the Collection
through which to interact with the document.entityType
- a Class describing the type of objects in this Set.options
- a ArraySetOptions
to use for all operations on this instance of the list.public int size()
size
in interface Collection<T>
size
in interface Set<T>
size
in class AbstractCollection<T>
public boolean isEmpty()
isEmpty
in interface Collection<T>
isEmpty
in interface Set<T>
isEmpty
in class AbstractCollection<T>
public boolean contains(Object t)
contains
in interface Collection<T>
contains
in interface Set<T>
contains
in class AbstractCollection<T>
public boolean add(T t)
add
in interface Collection<T>
add
in interface Set<T>
add
in class AbstractCollection<T>
public boolean remove(Object t)
remove
in interface Collection<T>
remove
in interface Set<T>
remove
in class AbstractCollection<T>
public void clear()
clear
in interface Collection<T>
clear
in interface Set<T>
clear
in class AbstractCollection<T>
Copyright © 2024 Couchbase, Inc.. All rights reserved.