V
- the type of values in the map (restricted to JsonObject
.@InterfaceStability.Experimental @InterfaceAudience.Public public class CouchbaseMap<V> extends AbstractMap<String,V>
A CouchbaseMap is a 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,
Bucket bucket)
|
CouchbaseMap(String id,
Bucket bucket,
Map<String,? extends V> data)
|
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Set<Map.Entry<String,V>> |
entrySet() |
V |
get(Object key) |
V |
put(String key,
V value) |
V |
remove(Object key) |
int |
size() |
clone, equals, hashCode, isEmpty, keySet, putAll, toString, values
finalize, getClass, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, entry, forEach, getOrDefault, merge, of, of, of, of, of, of, of, of, of, of, of, ofEntries, putIfAbsent, remove, replace, replace, replaceAll
public CouchbaseMap(String id, Bucket bucket)
Create a new 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.bucket
- the Bucket
through which to interact with the document.public CouchbaseMap(String id, Bucket bucket, Map<String,? extends V> data)
Create a new CouchbaseMap
, 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.
id
- the id of the Couchbase document to back the list.bucket
- the Bucket
through which to interact with the document.data
- Map of the elements to initially store in the CouchbaseMap.public void clear()
public boolean containsKey(Object key)
containsKey
in interface Map<String,V>
containsKey
in class AbstractMap<String,V>
public boolean containsValue(Object value)
containsValue
in interface Map<String,V>
containsValue
in class AbstractMap<String,V>
Copyright © 2015 Couchbase, Inc.