Class CouchbaseMap<E>
- java.lang.Object
-
- java.util.AbstractMap<String,E>
-
- com.couchbase.client.java.datastructures.CouchbaseMap<E>
-
- Type Parameters:
E- the type of values in the map (restricted toJsonObject.
@Committed public class CouchbaseMap<E> extends AbstractMap<String,E>
A CouchbaseMap is aMapbacked by aCouchbasedocument (more specifically aJSON object). Null keys are NOT permitted, and keys are restricted toString. Values in a CouchbaseMap are restricted to the types that aJSON objectscan contain. JSON sub-objects and sub-arrays can be represented asJsonObjectandJsonArrayrespectively.- Since:
- 2.3.6
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>
-
-
Constructor Summary
Constructors Constructor Description CouchbaseMap(String id, Collection collection, Class<E> entityType, MapOptions options)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()booleancontainsKey(Object key)booleancontainsValue(Object value)Set<Map.Entry<String,E>>entrySet()Eget(Object key)Eput(String key, E value)Eremove(Object key)intsize()-
Methods inherited from class java.util.AbstractMap
clone, equals, hashCode, isEmpty, keySet, putAll, toString, values
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
-
-
-
Constructor Detail
-
CouchbaseMap
public CouchbaseMap(String id, Collection collection, Class<E> entityType, MapOptions options)
Create a newCouchbaseMap, backed by the document identified byidin the given Couchbasebucket. 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 map.collection- theCollectionthrough which to interact with the document.entityType- aClassdescribing the type of objects used as values in this Map.options- aMapOptionsto use for all operations on this instance of the map.
-
-
Method Detail
-
clear
public void clear()
-
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKeyin interfaceMap<String,E>- Overrides:
containsKeyin classAbstractMap<String,E>
-
containsValue
public boolean containsValue(Object value)
- Specified by:
containsValuein interfaceMap<String,E>- Overrides:
containsValuein classAbstractMap<String,E>
-
-