E
- the type of values in the map (restricted to JsonObject
.@Stability.Committed public class CouchbaseMap<E> extends AbstractMap<String,E>
Map
backed by a Couchbase
document (more specifically a
JSON object
).
Null keys are NOT permitted, and keys are restricted to String
.
Values in a CouchbaseMap are restricted to the types that a JSON objects
can contain. JSON sub-objects and sub-arrays can be represented as JsonObject
and JsonArray
respectively.AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
CouchbaseMap(String id,
Collection collection,
Class<E> entityType,
MapOptions options)
|
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Set<Map.Entry<String,E>> |
entrySet() |
E |
get(Object key) |
E |
put(String key,
E value) |
E |
remove(Object key) |
int |
size() |
clone, equals, hashCode, isEmpty, keySet, putAll, toString, values
finalize, getClass, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
public CouchbaseMap(String id, Collection collection, Class<E> entityType, MapOptions options)
CouchbaseMap
, 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 map.collection
- the Collection
through which to interact with the document.entityType
- a Class
describing the type of objects used as values in this Map.options
- a MapOptions
to use for all operations on this instance of the map.public void clear()
public boolean containsKey(Object key)
containsKey
in interface Map<String,E>
containsKey
in class AbstractMap<String,E>
public boolean containsValue(Object value)
containsValue
in interface Map<String,E>
containsValue
in class AbstractMap<String,E>
Copyright © 2020 Couchbase, Inc.. All rights reserved.