Package org.infinispan.container.entries
Class NullCacheEntry<K,V>
- java.lang.Object
-
- org.infinispan.container.entries.NullCacheEntry<K,V>
-
- All Implemented Interfaces:
java.lang.Cloneable,java.util.Map.Entry<K,V>,CacheEntry<K,V>,MetadataAware
public class NullCacheEntry<K,V> extends java.lang.Object implements CacheEntry<K,V>
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CacheEntryclone()voidcommit(DataContainer container)Commits changesstatic <K,V>
NullCacheEntry<K,V>getInstance()KgetKey()Retrieves the key to this entrylonggetLifespan()longgetMaxIdle()MetadatagetMetadata()Get metadata of this cache entry.VgetValue()Retrieves the value of this entrybooleanisChanged()booleanisCreated()booleanisEvicted()booleanisNull()Tests whether the entry represents a null value, typically used for repeatable read.booleanisRemoved()voidsetChanged(boolean changed)voidsetCreated(boolean created)voidsetEvicted(boolean evicted)voidsetMetadata(Metadata metadata)Set the metadata in the cache entry.voidsetRemoved(boolean removed)voidsetSkipLookup(boolean skipLookup)java.lang.ObjectsetValue(java.lang.Object value)Sets the value of the entry, returning the previous valuebooleanskipLookup()java.lang.StringtoString()-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.infinispan.container.entries.CacheEntry
getCreated, getLastUsed, setCreated, setLastUsed
-
-
-
-
Method Detail
-
getInstance
public static <K,V> NullCacheEntry<K,V> getInstance()
-
isNull
public boolean isNull()
Description copied from interface:CacheEntryTests whether the entry represents a null value, typically used for repeatable read.- Specified by:
isNullin interfaceCacheEntry<K,V>- Returns:
- true if this represents a null, false otherwise.
-
isChanged
public boolean isChanged()
- Specified by:
isChangedin interfaceCacheEntry<K,V>- Returns:
- true if this entry has changed since being read from the container, false otherwise.
-
isCreated
public boolean isCreated()
- Specified by:
isCreatedin interfaceCacheEntry<K,V>- Returns:
- true if this entry has been newly created, false otherwise.
-
isRemoved
public boolean isRemoved()
- Specified by:
isRemovedin interfaceCacheEntry<K,V>- Returns:
- true if this entry has been removed since being read from the container, false otherwise.
-
isEvicted
public boolean isEvicted()
- Specified by:
isEvictedin interfaceCacheEntry<K,V>- Returns:
- true if this entry has been evicted since being read from the container, false otherwise.
-
getKey
public K getKey()
Description copied from interface:CacheEntryRetrieves the key to this entry
-
getValue
public V getValue()
Description copied from interface:CacheEntryRetrieves the value of this entry
-
getLifespan
public long getLifespan()
- Specified by:
getLifespanin interfaceCacheEntry<K,V>- Returns:
- retrieves the lifespan of this entry. -1 means an unlimited lifespan.
-
getMaxIdle
public long getMaxIdle()
- Specified by:
getMaxIdlein interfaceCacheEntry<K,V>- Returns:
- the maximum allowed time for which this entry can be idle, after which it is considered expired.
-
skipLookup
public boolean skipLookup()
- Specified by:
skipLookupin interfaceCacheEntry<K,V>- Returns:
trueif the value must not be fetch from an external source
-
setValue
public java.lang.Object setValue(java.lang.Object value)
Description copied from interface:CacheEntrySets the value of the entry, returning the previous value
-
commit
public void commit(DataContainer container)
Description copied from interface:CacheEntryCommits changes- Specified by:
commitin interfaceCacheEntry<K,V>- Parameters:
container- data container to commit to
-
setChanged
public void setChanged(boolean changed)
- Specified by:
setChangedin interfaceCacheEntry<K,V>
-
setCreated
public void setCreated(boolean created)
- Specified by:
setCreatedin interfaceCacheEntry<K,V>
-
setRemoved
public void setRemoved(boolean removed)
- Specified by:
setRemovedin interfaceCacheEntry<K,V>
-
setEvicted
public void setEvicted(boolean evicted)
- Specified by:
setEvictedin interfaceCacheEntry<K,V>
-
setSkipLookup
public void setSkipLookup(boolean skipLookup)
Description copied from interface:CacheEntry- Specified by:
setSkipLookupin interfaceCacheEntry<K,V>
-
clone
public CacheEntry clone()
- Specified by:
clonein interfaceCacheEntry<K,V>- Overrides:
clonein classjava.lang.Object
-
getMetadata
public Metadata getMetadata()
Description copied from interface:MetadataAwareGet metadata of this cache entry.- Specified by:
getMetadatain interfaceMetadataAware- Returns:
- a Metadata instance
-
setMetadata
public void setMetadata(Metadata metadata)
Description copied from interface:MetadataAwareSet the metadata in the cache entry.- Specified by:
setMetadatain interfaceMetadataAware- Parameters:
metadata- to apply to the cache entry
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-