Cache.Entry
Modifier and Type | Field and Description |
---|---|
boolean |
clearCalled |
Cache.Entry |
entryPut |
boolean |
getCalled |
String |
keyPut |
boolean |
putCalled |
Constructor and Description |
---|
MockCache() |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Empties the cache.
|
Cache.Entry |
get(String key)
Retrieves an entry from the cache.
|
void |
initialize()
Performs any potentially long-running actions needed to initialize the cache;
will be called from a worker thread.
|
void |
invalidate(String key,
boolean fullExpire)
Invalidates an entry in the cache.
|
void |
put(String key,
Cache.Entry entry)
Adds or replaces an entry to the cache.
|
void |
remove(String key)
Removes an entry from the cache.
|
void |
setEntryToReturn(Cache.Entry entry) |
public boolean clearCalled
public boolean getCalled
public boolean putCalled
public String keyPut
public Cache.Entry entryPut
public void clear()
Cache
public void setEntryToReturn(Cache.Entry entry)
public Cache.Entry get(String key)
Cache
get
in interface Cache
key
- Cache keyCache.Entry
or null in the event of a cache misspublic void put(String key, Cache.Entry entry)
Cache
public void invalidate(String key, boolean fullExpire)
Cache
invalidate
in interface Cache
key
- Cache keyfullExpire
- True to fully expire the entry, false to soft expirepublic void remove(String key)
Cache
public void initialize()
Cache
initialize
in interface Cache