org.springframework.core.enums
Class AbstractCachingLabeledEnumResolver.LabeledEnumCache
java.lang.Object
org.springframework.util.CachingMapDecorator<java.lang.Class,java.util.Map<java.lang.Comparable,LabeledEnum>>
org.springframework.core.enums.AbstractCachingLabeledEnumResolver.LabeledEnumCache
- All Implemented Interfaces:
- java.io.Serializable, java.util.Map<java.lang.Class,java.util.Map<java.lang.Comparable,LabeledEnum>>
- Enclosing class:
- AbstractCachingLabeledEnumResolver
private class AbstractCachingLabeledEnumResolver.LabeledEnumCache
- extends CachingMapDecorator<java.lang.Class,java.util.Map<java.lang.Comparable,LabeledEnum>>
Inner cache class that implements lazy building of LabeledEnum Maps.
Nested classes/interfaces inherited from interface java.util.Map |
java.util.Map.Entry<K,V> |
Method Summary |
protected java.util.Map<java.lang.Comparable,LabeledEnum> |
create(java.lang.Class key)
Create a value to cache for the given key. |
protected boolean |
useWeakValue(java.lang.Class key,
java.util.Map<java.lang.Comparable,LabeledEnum> value)
Decide whether to use a weak reference for the value of
the given key-value pair. |
Methods inherited from class org.springframework.util.CachingMapDecorator |
clear, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, toString, values |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
equals, hashCode |
AbstractCachingLabeledEnumResolver.LabeledEnumCache
public AbstractCachingLabeledEnumResolver.LabeledEnumCache()
create
protected java.util.Map<java.lang.Comparable,LabeledEnum> create(java.lang.Class key)
- Description copied from class:
CachingMapDecorator
- Create a value to cache for the given key.
Called by
get
if there is no value cached already.
- Specified by:
create
in class CachingMapDecorator<java.lang.Class,java.util.Map<java.lang.Comparable,LabeledEnum>>
- Parameters:
key
- the cache key- See Also:
CachingMapDecorator.get(Object)
useWeakValue
protected boolean useWeakValue(java.lang.Class key,
java.util.Map<java.lang.Comparable,LabeledEnum> value)
- Description copied from class:
CachingMapDecorator
- Decide whether to use a weak reference for the value of
the given key-value pair.
- Overrides:
useWeakValue
in class CachingMapDecorator<java.lang.Class,java.util.Map<java.lang.Comparable,LabeledEnum>>
- Parameters:
key
- the candidate keyvalue
- the candidate value
- Returns:
true
in order to use a weak reference;
false
otherwise.