public class CacheEvictableEntryImpl<K,V> extends Object implements EvictableEntry<K,V>
| Modifier and Type | Field and Description |
|---|---|
protected GridCacheEntryEx |
cached
Cached entry.
|
| Modifier | Constructor and Description |
|---|---|
protected |
CacheEvictableEntryImpl(GridCacheEntryEx cached) |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
addMeta(T val)
Adds a new metadata.
|
boolean |
equals(Object obj) |
boolean |
evict()
Evicts entry associated with given key from cache.
|
K |
getKey() |
V |
getValue() |
int |
hashCode() |
boolean |
isCached()
Checks whether entry is currently present in cache or not.
|
<T> T |
meta()
Gets metadata added by eviction policy.
|
V |
peek() |
<T> T |
putMetaIfAbsent(T val)
Adds given metadata value only if it was absent.
|
<T> T |
removeMeta()
Removes metadata by name.
|
<T> boolean |
removeMeta(T val)
Removes metadata only if its current value is equal to
val passed in. |
<T> boolean |
replaceMeta(T curVal,
T newVal)
Replaces given metadata with new
newVal value only if its current value
is equal to curVal. |
int |
size()
Returns entry size in bytes.
|
String |
toString() |
<T> T |
unwrap(Class<T> clazz) |
@GridToStringInclude protected GridCacheEntryEx cached
protected CacheEvictableEntryImpl(GridCacheEntryEx cached)
cached - Cached entry.public K getKey() throws IllegalStateException
getKey in interface javax.cache.Cache.Entry<K,V>IllegalStateExceptionpublic boolean isCached()
false is returned. In this case all
operations on this entry will cause creation of a new entry in cache.isCached in interface EvictableEntry<K,V>True if entry is in cache, false otherwise.public boolean evict()
evict in interface EvictableEntry<K,V>True if entry could be evicted, false otherwise.@Nullable public V peek()
public int size()
size in interface EvictableEntry<K,V>@Nullable public <T> T addMeta(T val)
addMeta in interface EvictableEntry<K,V>val - Metadata value.null if there was none.@Nullable public <T> T meta()
meta in interface EvictableEntry<K,V>null.@Nullable public <T> T removeMeta()
removeMeta in interface EvictableEntry<K,V>null.public <T> boolean removeMeta(T val)
val passed in.removeMeta in interface EvictableEntry<K,V>val - Value to compare.True if value was removed, false otherwise.@Nullable public <T> T putMetaIfAbsent(T val)
putMetaIfAbsent in interface EvictableEntry<K,V>val - Value to add if it's not attached already.null if new value was put, or current value if put didn't happen.public <T> boolean replaceMeta(T curVal,
T newVal)
newVal value only if its current value
is equal to curVal. Otherwise, it is no-op.replaceMeta in interface EvictableEntry<K,V>curVal - Current value to check.newVal - New value.true if replacement occurred, false otherwise.public <T> T unwrap(Class<T> clazz)
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.7.5 Release Date : June 4 2019