public interface Cache<KeyType extends Serializable,ValueType extends Serializable>
Cache
interface represents a cache intended for
application-level caching. In some circumstances it is more optimal to
implement caching directly in the code instead of relying on Hibernate
caching methods. This interface abstracts from the used cache implementation.
Cache implementations must be thread-safe.Modifier and Type | Method and Description |
---|---|
void |
clear()
Removes all entries from the cache.
|
ValueType |
get(KeyType aKey)
Retrieves a value from the cache.
|
void |
put(KeyType aKey,
ValueType aValue)
Adds a key-value pair to the cache.
|
void |
remove(KeyType aKey)
Removes an entry from the cache.
|
void put(KeyType aKey, ValueType aValue)
aKey
- Key.aValue
- Value.ValueType get(KeyType aKey)
aKey
- Key to retrieve.void remove(KeyType aKey)
aKey
- Key to remove the entry for.void clear()
Copyright © 2024. All rights reserved.