Package com.tangosol.coherence.rest.util
Class JsonMap
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- com.oracle.coherence.common.collections.InflatableMap<K,V>
-
- com.tangosol.util.LiteMap<String,Object>
-
- com.tangosol.coherence.rest.util.JsonMap
-
- All Implemented Interfaces:
ExternalizableLite
,Versionable<Integer>
,Externalizable
,Serializable
,Cloneable
,Map<String,Object>
public class JsonMap extends LiteMap<String,Object> implements Versionable<Integer>
A simple wrapper aroundLiteMap
that preserves the order of elements and adds support for POF serialization without fidelity loss in order to support JSON pass-through.- Author:
- as 2015.08.25
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
JsonMap.Serializer
POF serializer for JsonMap.-
Nested classes/interfaces inherited from class com.oracle.coherence.common.collections.InflatableMap
com.oracle.coherence.common.collections.InflatableMap.EntryIterator<K,V>, com.oracle.coherence.common.collections.InflatableMap.EntrySet
-
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>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Integer
getVersionIndicator()
Get the version indicator for this object.void
incrementVersion()
Update the version to the next logical version indicator.protected Map<String,Object>
instantiateMap()
(Factory pattern) Instantiate a Map object to store entries in once the "lite" threshold has been exceeded.Object
put(String key, Object value)
Associates the specified value with the specified key in this map.-
Methods inherited from class com.tangosol.util.LiteMap
readExternal, writeExternal
-
Methods inherited from class com.oracle.coherence.common.collections.InflatableMap
checkShrinkFromOther, clear, clone, containsKey, ensureRuntimeException, entrySet, get, instantiateEntry, instantiateEntrySet, isEmpty, readExternal, remove, size, writeExternal
-
Methods inherited from class java.util.AbstractMap
containsValue, equals, hashCode, 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
-
Methods inherited from interface com.tangosol.util.Versionable
isVersioningEnabled
-
-
-
-
Method Detail
-
instantiateMap
protected Map<String,Object> instantiateMap()
Description copied from class:com.oracle.coherence.common.collections.InflatableMap
(Factory pattern) Instantiate a Map object to store entries in once the "lite" threshold has been exceeded. This method permits inheriting classes to easily override the choice of the Map object.
-
put
public Object put(String key, Object value)
Description copied from class:com.oracle.coherence.common.collections.InflatableMap
Associates the specified value with the specified key in this map.- Specified by:
put
in interfaceMap<String,Object>
- Overrides:
put
in classcom.oracle.coherence.common.collections.InflatableMap<String,Object>
- Parameters:
key
- key with which the specified value is to be associatedvalue
- value to be associated with the specified key- Returns:
- previous value associated with specified key, or null if there was no mapping for key
-
getVersionIndicator
public Integer getVersionIndicator()
Description copied from interface:Versionable
Get the version indicator for this object. The version indicator should be an immutable object or one treated as an immutable, which is to say that after the version is incremented, the previous version's indicator reference will never be returned again.- Specified by:
getVersionIndicator
in interfaceVersionable<Integer>
- Returns:
- a non-null version value that implements the Comparable interface
-
incrementVersion
public void incrementVersion()
Description copied from interface:Versionable
Update the version to the next logical version indicator.- Specified by:
incrementVersion
in interfaceVersionable<Integer>
-
-