Class CouchbaseArraySet<T>

java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractSet<T>
com.couchbase.client.java.datastructures.collections.CouchbaseArraySet<T>
Type Parameters:
T - the type of values in the set.
All Implemented Interfaces:
Iterable<T>, Collection<T>, Set<T>

@Committed
@Public
public class CouchbaseArraySet<T>
extends AbstractSet<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
Author:
Simon Baslé, Subhashni Balakrishnan
  • Constructor Details

    • CouchbaseArraySet

      public CouchbaseArraySet​(String id, Bucket bucket)
      Create a new 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.
      Parameters:
      id - the id of the Couchbase document to back the set.
      bucket - the Bucket through which to interact with the document.
    • CouchbaseArraySet

      public CouchbaseArraySet​(String id, Bucket bucket, Set<? extends T> initialData)
      Create a new CouchbaseArraySet, backed by the document identified by id in the given Couchbase bucket. Note that if the document already exists, its content is reset to the values copied from the given data Map. A null or empty data map will re-initialize any pre-existing document to an empty content.
      Parameters:
      id - the id of the Couchbase document to back the set.
      bucket - the Bucket through which to interact with the document.
      initialData - Set of the elements to initially store in the CouchbaseArraySet.
  • Method Details