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
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractInternalCacheEntry(Object key, Object value, PrivateMetadata internalMetadata) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidappendFieldsToString(StringBuilder builder) clone()final voidcommit(DataContainer container) Commits changesfinal booleanfinal PrivateMetadatafinal ObjectgetKey()Retrieves the key to this entryGet metadata of this cache entry.final ObjectgetValue()Retrieves the value of this entryfinal inthashCode()final booleanfinal booleanfinal booleanbooleanfinal booleanisNull()Tests whether the entry represents a null value, typically used for repeatable read.final booleanvoidsetChanged(boolean changed) final voidsetCreated(boolean created) final voidsetEvicted(boolean evicted) final voidsetInternalMetadata(PrivateMetadata metadata) voidsetMetadata(Metadata metadata) Set the metadata in the cache entry.final voidsetRemoved(boolean removed) voidsetSkipLookup(boolean skipLookup) final ObjectSets the value of the entry, returning the previous valuebooleanfinal StringtoString()Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.infinispan.container.entries.CacheEntry
getCreated, getLastUsed, getLifespan, getMaxIdle, setCreated, setLastUsedMethods 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:CacheEntryCommits changes- Specified by:
commitin interfaceCacheEntry- Parameters:
container- data container to commit to
-
setChanged
public void setChanged(boolean changed) - Specified by:
setChangedin interfaceCacheEntry
-
setCreated
public final void setCreated(boolean created) - Specified by:
setCreatedin interfaceCacheEntry
-
setRemoved
public final void setRemoved(boolean removed) - Specified by:
setRemovedin interfaceCacheEntry
-
setEvicted
public final void setEvicted(boolean evicted) - Specified by:
setEvictedin interfaceCacheEntry
-
setSkipLookup
public void setSkipLookup(boolean skipLookup) Description copied from interface:CacheEntry- Specified by:
setSkipLookupin interfaceCacheEntry
-
isNull
public final boolean isNull()Description copied from interface:CacheEntryTests whether the entry represents a null value, typically used for repeatable read.- Specified by:
isNullin interfaceCacheEntry- Returns:
- true if this represents a null, false otherwise.
-
isChanged
public final boolean isChanged()- Specified by:
isChangedin interfaceCacheEntry- Returns:
- true if this entry has changed since being read from the container, false otherwise.
-
isCreated
public final boolean isCreated()- Specified by:
isCreatedin interfaceCacheEntry- Returns:
- true if this entry has been newly created, false otherwise.
-
isRemoved
public final boolean isRemoved()- Specified by:
isRemovedin interfaceCacheEntry- Returns:
- true if this entry has been removed since being read from the container, false otherwise.
-
isEvicted
public final boolean isEvicted()- Specified by:
isEvictedin interfaceCacheEntry- Returns:
- true if this entry has been evicted since being read from the container, false otherwise.
-
skipLookup
public boolean skipLookup()- Specified by:
skipLookupin interfaceCacheEntry- Returns:
trueif the value must not be fetch from an external source
-
getMetadata
Description copied from interface:MetadataAwareGet metadata of this cache entry.- Specified by:
getMetadatain interfaceMetadataAware- Returns:
- a Metadata instance
-
setMetadata
Description copied from interface:MetadataAwareSet the metadata in the cache entry.- Specified by:
setMetadatain interfaceMetadataAware- Parameters:
metadata- to apply to the cache entry
-
getKey
Description copied from interface:CacheEntryRetrieves the key to this entry- Specified by:
getKeyin interfaceCacheEntry- Specified by:
getKeyin interfaceMap.Entry- Returns:
- a key
-
getValue
Description copied from interface:CacheEntryRetrieves the value of this entry- Specified by:
getValuein interfaceCacheEntry- Specified by:
getValuein interfaceMap.Entry- Returns:
- the value of the entry
-
setValue
Description copied from interface:CacheEntrySets the value of the entry, returning the previous value- Specified by:
setValuein interfaceCacheEntry- Specified by:
setValuein interfaceMap.Entry- Parameters:
value- value to set- Returns:
- previous value
-
isL1Entry
public boolean isL1Entry()- Specified by:
isL1Entryin interfaceInternalCacheEntry- Returns:
trueif the entry is a L1 entry.
-
getInternalMetadata
- Specified by:
getInternalMetadatain interfaceCacheEntry
-
setInternalMetadata
- Specified by:
setInternalMetadatain interfaceCacheEntry
-
toString
-
clone
- Specified by:
clonein interfaceCacheEntry- Specified by:
clonein interfaceInternalCacheEntry- Overrides:
clonein classObject
-
equals
-
hashCode
public final int hashCode() -
appendFieldsToString
-