public abstract class AbstractMapCacheLevel extends Object implements CacheLevel
Constructor and Description |
---|
AbstractMapCacheLevel() |
Modifier and Type | Method and Description |
---|---|
protected void |
disableKeyFallback()
Disables the fallback key.
|
protected void |
disableSingeValueFallback()
Disables the single value fallback.
|
protected void |
enableKeyFallback(String key)
Enables a fallback key if no value was found for a requested key.
|
protected void |
enableSingeValueFallback()
Enables the single value fallback.
|
Object |
get(String key)
Retrieves an object from the cache level.
|
protected boolean |
getBooleanParameter(Map<String,String> parameters,
String name,
boolean defValue)
Extracts a boolean parameter from the parameters.
|
protected float |
getFloatParameter(Map<String,String> parameters,
String name,
float defValue)
Extracts a float parameter from the parameters.
|
protected int |
getIntParameter(Map<String,String> parameters,
String name,
int defValue)
Extracts an integer parameter from the parameters.
|
protected Map<String,Object> |
getMap()
Returns the internal map.
|
abstract void |
initialize(Map<String,String> parameters)
Initialize the cache level.
|
void |
put(Object value,
String key)
Adds an object to the cache level.
|
void |
remove(String key)
Removes an object from this cache level.
|
protected void |
setMap(Map<String,Object> map)
Sets the internal map.
|
String |
toString() |
public abstract void initialize(Map<String,String> parameters)
CacheLevel
initialize
in interface CacheLevel
parameters
- level parameterspublic Object get(String key)
CacheLevel
get
in interface CacheLevel
key
- the key at this cache levelnull
if the object doesn't existpublic void put(Object value, String key)
CacheLevel
put
in interface CacheLevel
value
- the objectkey
- the key at this levelpublic void remove(String key)
CacheLevel
remove
in interface CacheLevel
key
- the key at this cache levelprotected void enableKeyFallback(String key)
protected void disableKeyFallback()
protected void enableSingeValueFallback()
protected void disableSingeValueFallback()
protected int getIntParameter(Map<String,String> parameters, String name, int defValue)
parameters
- the parameter mapname
- the parameter namedefValue
- the default value if the parameter can't be foundprotected float getFloatParameter(Map<String,String> parameters, String name, float defValue)
parameters
- the parameter mapname
- the parameter namedefValue
- the default value if the parameter can't be foundprotected boolean getBooleanParameter(Map<String,String> parameters, String name, boolean defValue)
parameters
- the parameter mapname
- the parameter namedefValue
- the default value if the parameter can't be foundCopyright © 2009-2014 The Apache Software Foundation. All Rights Reserved.