Package org.infinispan.container.entries
Interface CacheEntry<K,V>
- All Superinterfaces:
Cloneable
,Map.Entry<K,
,V> MetadataAware
- All Known Subinterfaces:
InternalCacheEntry<K,
,V> MVCCEntry<K,
V>
- All Known Implementing Classes:
AbstractInternalCacheEntry
,ClearCacheEntry
,EntryWrapper
,ForwardingCacheEntry
,ImmortalCacheEntry
,L1InternalCacheEntry
,L1MetadataInternalCacheEntry
,MetadataImmortalCacheEntry
,MetadataMortalCacheEntry
,MetadataTransientCacheEntry
,MetadataTransientMortalCacheEntry
,MortalCacheEntry
,NullCacheEntry
,ReadCommittedEntry
,RepeatableReadEntry
,TransientCacheEntry
,TransientMortalCacheEntry
,VersionedRepeatableReadEntry
An entry that is stored in the data container
- Since:
- 4.0
- Author:
- Manik Surtani, Galder ZamarreƱo
-
Method Summary
Modifier and TypeMethodDescriptionCacheEntry
<K, V> clone()
void
commit
(DataContainer<K, V> container) Commits changesdefault long
default PrivateMetadata
getKey()
Retrieves the key to this entrydefault long
long
long
getValue()
Retrieves the value of this entryboolean
boolean
boolean
boolean
isNull()
Tests whether the entry represents a null value, typically used for repeatable read.boolean
void
setChanged
(boolean changed) void
setCreated
(boolean created) default void
setCreated
(long created) void
setEvicted
(boolean evicted) default void
setInternalMetadata
(PrivateMetadata metadata) default void
setLastUsed
(long lastUsed) void
setRemoved
(boolean removed) void
setSkipLookup
(boolean skipLookup) SeeskipLookup()
.Sets the value of the entry, returning the previous valueboolean
Methods inherited from interface org.infinispan.container.entries.metadata.MetadataAware
getMetadata, setMetadata
-
Method Details
-
isNull
boolean isNull()Tests whether the entry represents a null value, typically used for repeatable read.- Returns:
- true if this represents a null, false otherwise.
-
isChanged
boolean isChanged()- Returns:
- true if this entry has changed since being read from the container, false otherwise.
-
isCreated
boolean isCreated()- Returns:
- true if this entry has been newly created, false otherwise.
-
isRemoved
boolean isRemoved()- Returns:
- true if this entry has been removed since being read from the container, false otherwise.
-
isEvicted
boolean isEvicted()- Returns:
- true if this entry has been evicted since being read from the container, false otherwise.
-
getKey
K getKey()Retrieves the key to this entry -
getValue
V getValue()Retrieves the value of this entry -
getLifespan
long getLifespan()- Returns:
- retrieves the lifespan of this entry. -1 means an unlimited lifespan.
-
getMaxIdle
long getMaxIdle()- Returns:
- the maximum allowed time for which this entry can be idle, after which it is considered expired.
-
skipLookup
boolean skipLookup()- Returns:
true
if the value must not be fetch from an external source
-
getCreated
default long getCreated()- Returns:
- timestamp when the entry was created
-
getLastUsed
default long getLastUsed()- Returns:
- timestamp when the entry was last used
-
setValue
Sets the value of the entry, returning the previous value -
commit
Commits changes- Parameters:
container
- data container to commit to
-
setChanged
void setChanged(boolean changed) -
setCreated
void setCreated(boolean created) -
setRemoved
void setRemoved(boolean removed) -
setEvicted
void setEvicted(boolean evicted) -
setSkipLookup
void setSkipLookup(boolean skipLookup) SeeskipLookup()
.- Parameters:
skipLookup
-
-
clone
CacheEntry<K,V> clone() -
setCreated
default void setCreated(long created) -
setLastUsed
default void setLastUsed(long lastUsed) -
getInternalMetadata
-
setInternalMetadata
-