org.opencms.util
Class CmsConstantMap<K,V>

java.lang.Object
  extended by org.opencms.util.CmsConstantMap<K,V>
Type Parameters:
K - the type of keys maintained by this map
V - the type of mapped values
All Implemented Interfaces:
Map<K,V>

public class CmsConstantMap<K,V>
extends Object
implements Map<K,V>

Returns the constant Object the map was initialized with for all get(Object) calls, regardless of what the actual key is.

Since:
7.0.2

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Field Summary
static Map<String,Boolean> CONSTANT_BOOLEAN_FALSE_MAP
          Constant Map that always returns Boolean.FALSE.
static Map<String,Boolean> CONSTANT_BOOLEAN_TRUE_MAP
          Constant Map that always returns Boolean.TRUE.
static Map<String,List<CmsJspContentAccessValueWrapper>> CONSTANT_EMPTY_LIST_MAP
          Constant Map that always returns an empty list.
 
Constructor Summary
CmsConstantMap(V constant)
          Creates a new constant Map.
 
Method Summary
 void clear()
           
 boolean containsKey(Object key)
           
 boolean containsValue(Object value)
           
 Set<Map.Entry<K,V>> entrySet()
           
 boolean equals(Object obj)
           
 V get(Object key)
           
 int hashCode()
           
 boolean isEmpty()
           
 Set<K> keySet()
           
 V put(Object arg0, Object arg1)
           
 void putAll(Map<? extends K,? extends V> arg0)
           
 V remove(Object key)
           
 int size()
           
 Collection<V> values()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONSTANT_BOOLEAN_FALSE_MAP

public static final Map<String,Boolean> CONSTANT_BOOLEAN_FALSE_MAP
Constant Map that always returns Boolean.FALSE.


CONSTANT_BOOLEAN_TRUE_MAP

public static final Map<String,Boolean> CONSTANT_BOOLEAN_TRUE_MAP
Constant Map that always returns Boolean.TRUE.


CONSTANT_EMPTY_LIST_MAP

public static final Map<String,List<CmsJspContentAccessValueWrapper>> CONSTANT_EMPTY_LIST_MAP
Constant Map that always returns an empty list.

Constructor Detail

CmsConstantMap

public CmsConstantMap(V constant)
Creates a new constant Map.

Parameters:
constant - the constant to return for all get(Object) calls.

Method Detail

clear

public void clear()
Specified by:
clear in interface Map<K,V>
See Also:
Map.clear()

containsKey

public boolean containsKey(Object key)
Specified by:
containsKey in interface Map<K,V>
See Also:
Map.containsKey(java.lang.Object)

containsValue

public boolean containsValue(Object value)
Specified by:
containsValue in interface Map<K,V>
See Also:
Map.containsValue(java.lang.Object)

entrySet

public Set<Map.Entry<K,V>> entrySet()
Specified by:
entrySet in interface Map<K,V>
See Also:
Map.entrySet()

equals

public boolean equals(Object obj)
Specified by:
equals in interface Map<K,V>
Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

get

public V get(Object key)
Specified by:
get in interface Map<K,V>
See Also:
Map.get(java.lang.Object)

hashCode

public int hashCode()
Specified by:
hashCode in interface Map<K,V>
Overrides:
hashCode in class Object
See Also:
Object.hashCode()

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Map<K,V>
See Also:
Map.isEmpty()

keySet

public Set<K> keySet()
Specified by:
keySet in interface Map<K,V>
See Also:
Map.keySet()

put

public V put(Object arg0,
             Object arg1)
Specified by:
put in interface Map<K,V>
See Also:
Map.put(java.lang.Object, java.lang.Object)

putAll

public void putAll(Map<? extends K,? extends V> arg0)
Specified by:
putAll in interface Map<K,V>
See Also:
Map.putAll(java.util.Map)

remove

public V remove(Object key)
Specified by:
remove in interface Map<K,V>
See Also:
Map.remove(java.lang.Object)

size

public int size()
Specified by:
size in interface Map<K,V>
See Also:
Map.size()

values

public Collection<V> values()
Specified by:
values in interface Map<K,V>
See Also:
Map.values()