Package org.apache.wicket.markup
Interface MarkupCache.ICache<K,V>
-
- Type Parameters:
K
- The key typeV
- The value type
- All Known Implementing Classes:
MarkupCache.DefaultCacheImplementation
- Enclosing class:
- MarkupCache
public static interface MarkupCache.ICache<K,V>
MarkupCache allows you to implement you own cache implementation. ICache is the interface the implementation must comply with.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
clear()
Clear the cacheboolean
containsKey(K key)
Check if key is in the cacheV
get(K key)
Get the cache element associated with the keyCollection<K>
getKeys()
Get all the keys referencing cache entriesCollection<V>
getValues()
Get all the values referencing cache entriesvoid
put(K key, V value)
Put an entry into the cacheboolean
remove(K key)
Remove an entry from the cache.void
shutdown()
Cleanup and shutdownint
size()
Get the number of cache entries
-
-
-
Method Detail
-
clear
void clear()
Clear the cache
-
remove
boolean remove(K key)
Remove an entry from the cache.- Parameters:
key
-- Returns:
- true, if found and removed
-
get
V get(K key)
Get the cache element associated with the key- Parameters:
key
-- Returns:
- cached object for key
key
or null if no matches
-
getKeys
Collection<K> getKeys()
Get all the keys referencing cache entries- Returns:
- collection of cached keys
-
getValues
Collection<V> getValues()
Get all the values referencing cache entries- Returns:
- collection of cached keys
-
containsKey
boolean containsKey(K key)
Check if key is in the cache- Parameters:
key
-- Returns:
- true if cache contains key
key
-
size
int size()
Get the number of cache entries- Returns:
- number of cache entries
-
put
void put(K key, V value)
Put an entry into the cache- Parameters:
key
- The reference key to find the element. Must not be null.value
- The element to be cached. Must not be null.
-
shutdown
void shutdown()
Cleanup and shutdown
-
-