Nuxeo Enterprise Platform 5.4

org.nuxeo.common.collections
Class ScopedMap

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap<java.lang.String,java.io.Serializable>
          extended by org.nuxeo.common.collections.ScopedMap
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.String,java.io.Serializable>

public class ScopedMap
extends java.util.HashMap<java.lang.String,java.io.Serializable>

Scoped map holding data for a given scope.

Used to store context data and invalidate some data given its scope. Implements Map for easier use from interface.

Author:
Anahide Tchertchian
See Also:
ScopeType, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>
 
Constructor Summary
ScopedMap()
           
 
Method Summary
 void clearScope(ScopeType scopeType)
          Removes all mappings for given scope.
 java.util.Map<java.lang.String,java.io.Serializable> getDefaultScopeValues()
          Creates a Map with entries from DEFAULT scope.
 java.io.Serializable getScopedValue(ScopeType scope, java.lang.String key)
          Gets value for given scope and given key.
 java.io.Serializable getScopedValue(java.lang.String key)
          Gets value for given key using default scope.
 java.util.Map<java.lang.String,java.io.Serializable> getScopeValues(ScopeType scopeType)
          Creates a Map with entries from specified scope.
 void putScopedValue(ScopeType scope, java.lang.String key, java.io.Serializable value)
          Sets value for given scope and given key.
 void putScopedValue(java.lang.String key, java.io.Serializable value)
          Sets key using default scope.
 
Methods inherited from class java.util.HashMap
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

ScopedMap

public ScopedMap()
Method Detail

getScopedValue

public java.io.Serializable getScopedValue(ScopeType scope,
                                           java.lang.String key)
Gets value for given scope and given key.


getScopedValue

public java.io.Serializable getScopedValue(java.lang.String key)
Gets value for given key using default scope.


getDefaultScopeValues

public java.util.Map<java.lang.String,java.io.Serializable> getDefaultScopeValues()
Creates a Map with entries from DEFAULT scope.


getScopeValues

public java.util.Map<java.lang.String,java.io.Serializable> getScopeValues(ScopeType scopeType)
Creates a Map with entries from specified scope.


putScopedValue

public void putScopedValue(ScopeType scope,
                           java.lang.String key,
                           java.io.Serializable value)
Sets value for given scope and given key.


putScopedValue

public void putScopedValue(java.lang.String key,
                           java.io.Serializable value)
Sets key using default scope.


clearScope

public void clearScope(ScopeType scopeType)
Removes all mappings for given scope.


Nuxeo Enterprise Platform 5.4

Copyright © 2010 Nuxeo SAS. All Rights Reserved.