Package org.apache.groovy.json.internal
Interface Cache<KEY,VALUE>
- Type Parameters:
KEY- keyVALUE- value
- All Known Implementing Classes:
SimpleCache
public interface Cache<KEY,VALUE>
Cache
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves a value and updates cache state as needed.Retrieves a value using implementation-specific silent access semantics.voidStores a value under the supplied key.voidRemoves the value stored for the supplied key.intsize()Returns the current number of cached entries.
-
Method Details
-
put
Stores a value under the supplied key.- Parameters:
key- the cache keyvalue- the cached value
-
get
Retrieves a value and updates cache state as needed.- Parameters:
key- the cache key- Returns:
- the cached value, or
nullif absent
-
getSilent
Retrieves a value using implementation-specific silent access semantics.- Parameters:
key- the cache key- Returns:
- the cached value, or
nullif absent
-
remove
Removes the value stored for the supplied key.- Parameters:
key- the cache key
-
size
int size()Returns the current number of cached entries.- Returns:
- the cache size
-