Class CouchbaseQueue<E>

java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractQueue<E>
com.couchbase.client.java.datastructures.CouchbaseQueue<E>
Type Parameters:
E - the type of values in the queue.
All Implemented Interfaces:
Iterable<E>, Collection<E>, Queue<E>

@Committed
public class CouchbaseQueue<E>
extends AbstractQueue<E>
A CouchbaseQueue is a Queue backed by a Couchbase document (more specifically a JSON array). Note that as such, a CouchbaseQueue is restricted to the types that a JSON array can contain. JSON objects and sub-arrays can be represented as JsonObject and JsonArray respectively. Null values are not allowed as they have special meaning for the peek() and AbstractQueue.remove() methods of a queue.
Since:
2.3.6
  • Constructor Details

    • CouchbaseQueue

      public CouchbaseQueue​(String id, Collection collection, Class<E> entityType, QueueOptions options)
      Create a new Couchbase-backed Queue, backed by the document identified by id in 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 queue.
      collection - the Collection through which to interact with the document.
      entityType - a Class<E> describing the type of objects in this Set.
      options - a CommonDatastructureOptions to use for all operations on this instance of the queue.
  • Method Details