Package org.infinispan.container.entries
Class AbstractInternalCacheEntry
java.lang.Object
org.infinispan.container.entries.AbstractInternalCacheEntry
- All Implemented Interfaces:
Cloneable
,Map.Entry
,CacheEntry
,InternalCacheEntry
,MetadataAware
- Direct Known Subclasses:
ImmortalCacheEntry
,MetadataMortalCacheEntry
,MetadataTransientCacheEntry
,MetadataTransientMortalCacheEntry
,MortalCacheEntry
,TransientCacheEntry
,TransientMortalCacheEntry
An abstract internal cache entry that is typically stored in the data container
- Since:
- 4.0
- Author:
- Manik Surtani
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractInternalCacheEntry
(Object key, Object value, PrivateMetadata internalMetadata) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
appendFieldsToString
(StringBuilder builder) clone()
final void
commit
(DataContainer container) Commits changesfinal boolean
final PrivateMetadata
final Object
getKey()
Retrieves the key to this entryGet metadata of this cache entry.final Object
getValue()
Retrieves the value of this entryfinal int
hashCode()
final boolean
final boolean
final boolean
boolean
final boolean
isNull()
Tests whether the entry represents a null value, typically used for repeatable read.final boolean
void
setChanged
(boolean changed) final void
setCreated
(boolean created) final void
setEvicted
(boolean evicted) final void
setInternalMetadata
(PrivateMetadata metadata) void
setMetadata
(Metadata metadata) Set the metadata in the cache entry.final void
setRemoved
(boolean removed) void
setSkipLookup
(boolean skipLookup) final Object
Sets the value of the entry, returning the previous valueboolean
final String
toString()
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.infinispan.container.entries.CacheEntry
getCreated, getLastUsed, getLifespan, getMaxIdle, setCreated, setLastUsed
Methods inherited from interface org.infinispan.container.entries.InternalCacheEntry
canExpire, canExpireMaxIdle, getExpiryTime, isExpired, reincarnate, toInternalCacheValue, touch
-
Field Details
-
key
-
value
-
internalMetadata
-
-
Constructor Details
-
AbstractInternalCacheEntry
-
-
Method Details
-
commit
Description copied from interface:CacheEntry
Commits changes- Specified by:
commit
in interfaceCacheEntry
- Parameters:
container
- data container to commit to
-
setChanged
public void setChanged(boolean changed) - Specified by:
setChanged
in interfaceCacheEntry
-
setCreated
public final void setCreated(boolean created) - Specified by:
setCreated
in interfaceCacheEntry
-
setRemoved
public final void setRemoved(boolean removed) - Specified by:
setRemoved
in interfaceCacheEntry
-
setEvicted
public final void setEvicted(boolean evicted) - Specified by:
setEvicted
in interfaceCacheEntry
-
setSkipLookup
public void setSkipLookup(boolean skipLookup) Description copied from interface:CacheEntry
- Specified by:
setSkipLookup
in interfaceCacheEntry
-
isNull
public final boolean isNull()Description copied from interface:CacheEntry
Tests whether the entry represents a null value, typically used for repeatable read.- Specified by:
isNull
in interfaceCacheEntry
- Returns:
- true if this represents a null, false otherwise.
-
isChanged
public final boolean isChanged()- Specified by:
isChanged
in interfaceCacheEntry
- Returns:
- true if this entry has changed since being read from the container, false otherwise.
-
isCreated
public final boolean isCreated()- Specified by:
isCreated
in interfaceCacheEntry
- Returns:
- true if this entry has been newly created, false otherwise.
-
isRemoved
public final boolean isRemoved()- Specified by:
isRemoved
in interfaceCacheEntry
- Returns:
- true if this entry has been removed since being read from the container, false otherwise.
-
isEvicted
public final boolean isEvicted()- Specified by:
isEvicted
in interfaceCacheEntry
- Returns:
- true if this entry has been evicted since being read from the container, false otherwise.
-
skipLookup
public boolean skipLookup()- Specified by:
skipLookup
in interfaceCacheEntry
- Returns:
true
if the value must not be fetch from an external source
-
getMetadata
Description copied from interface:MetadataAware
Get metadata of this cache entry.- Specified by:
getMetadata
in interfaceMetadataAware
- Returns:
- a Metadata instance
-
setMetadata
Description copied from interface:MetadataAware
Set the metadata in the cache entry.- Specified by:
setMetadata
in interfaceMetadataAware
- Parameters:
metadata
- to apply to the cache entry
-
getKey
Description copied from interface:CacheEntry
Retrieves the key to this entry- Specified by:
getKey
in interfaceCacheEntry
- Specified by:
getKey
in interfaceMap.Entry
- Returns:
- a key
-
getValue
Description copied from interface:CacheEntry
Retrieves the value of this entry- Specified by:
getValue
in interfaceCacheEntry
- Specified by:
getValue
in interfaceMap.Entry
- Returns:
- the value of the entry
-
setValue
Description copied from interface:CacheEntry
Sets the value of the entry, returning the previous value- Specified by:
setValue
in interfaceCacheEntry
- Specified by:
setValue
in interfaceMap.Entry
- Parameters:
value
- value to set- Returns:
- previous value
-
isL1Entry
public boolean isL1Entry()- Specified by:
isL1Entry
in interfaceInternalCacheEntry
- Returns:
true
if the entry is a L1 entry.
-
getInternalMetadata
- Specified by:
getInternalMetadata
in interfaceCacheEntry
-
setInternalMetadata
- Specified by:
setInternalMetadata
in interfaceCacheEntry
-
toString
-
clone
- Specified by:
clone
in interfaceCacheEntry
- Specified by:
clone
in interfaceInternalCacheEntry
- Overrides:
clone
in classObject
-
equals
-
hashCode
public final int hashCode() -
appendFieldsToString
-