Package javax.cache
Interface Cache.Entry<K,V>
-
- All Known Subinterfaces:
MutableEntry<K,V>
- All Known Implementing Classes:
CacheEntryEvent
public static interface Cache.Entry<K,V>
A cache entry (key-value pair).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description K
getKey()
Returns the key corresponding to this entry.V
getValue()
Returns the value stored in the cache when this entry was created.<T> T
unwrap(Class<T> clazz)
Provides a standard way to access the underlying concrete cache entry implementation in order to provide access to further, proprietary features.
-
-
-
Method Detail
-
getKey
K getKey()
Returns the key corresponding to this entry.- Returns:
- the key corresponding to this entry
-
getValue
V getValue()
Returns the value stored in the cache when this entry was created.- Returns:
- the value corresponding to this entry
-
unwrap
<T> T unwrap(Class<T> clazz)
Provides a standard way to access the underlying concrete cache entry implementation in order to provide access to further, proprietary features.If the provider's implementation does not support the specified class, the
IllegalArgumentException
is thrown.- Type Parameters:
T
- the type of the underlyingCache.Entry
implementation- Parameters:
clazz
- the proprietary class or interface of the underlying concrete cache. It is this type that is returned.- Returns:
- an instance of the underlying concrete cache
- Throws:
IllegalArgumentException
- if the caching provider doesn't support the specified class.
-
-