Package org.infinispan.container.entries
Class ImmortalCacheValue
- java.lang.Object
-
- org.infinispan.container.entries.ImmortalCacheValue
-
- All Implemented Interfaces:
Cloneable
,InternalCacheValue
- Direct Known Subclasses:
MetadataImmortalCacheValue
,MetadataMortalCacheValue
,MetadataTransientCacheValue
,MortalCacheValue
,TransientCacheValue
public class ImmortalCacheValue extends Object implements InternalCacheValue, Cloneable
An immortal cache value, to correspond withImmortalCacheEntry
- Since:
- 4.0
- Author:
- Manik Surtani
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ImmortalCacheValue.Externalizer
-
Constructor Summary
Constructors Constructor Description ImmortalCacheValue(Object value)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canExpire()
ImmortalCacheValue
clone()
boolean
equals(Object o)
long
getCreated()
long
getExpiryTime()
long
getLastUsed()
long
getLifespan()
long
getMaxIdle()
Metadata
getMetadata()
Object
getValue()
int
hashCode()
boolean
isExpired()
boolean
isExpired(long now)
Object
setValue(Object value)
InternalCacheEntry
toInternalCacheEntry(Object key)
String
toString()
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.infinispan.container.entries.InternalCacheValue
isMaxIdleExpirable
-
-
-
-
Field Detail
-
value
public Object value
-
-
Constructor Detail
-
ImmortalCacheValue
public ImmortalCacheValue(Object value)
-
-
Method Detail
-
toInternalCacheEntry
public InternalCacheEntry toInternalCacheEntry(Object key)
- Specified by:
toInternalCacheEntry
in interfaceInternalCacheValue
-
getValue
public Object getValue()
- Specified by:
getValue
in interfaceInternalCacheValue
- Returns:
- the value represented by this internal wrapper
-
isExpired
public boolean isExpired(long now)
- Specified by:
isExpired
in interfaceInternalCacheValue
- Parameters:
now
- the current time as expressed bySystem.currentTimeMillis()
- Returns:
- true if the entry has expired; false otherwise
-
isExpired
public boolean isExpired()
- Specified by:
isExpired
in interfaceInternalCacheValue
- Returns:
- true if the entry has expired; false otherwise
-
canExpire
public boolean canExpire()
- Specified by:
canExpire
in interfaceInternalCacheValue
- Returns:
- true if the entry can expire, false otherwise
-
getCreated
public long getCreated()
- Specified by:
getCreated
in interfaceInternalCacheValue
- Returns:
- timestamp when the entry was created
-
getLastUsed
public long getLastUsed()
- Specified by:
getLastUsed
in interfaceInternalCacheValue
- Returns:
- timestamp when the entry was last used
-
getLifespan
public long getLifespan()
- Specified by:
getLifespan
in interfaceInternalCacheValue
- Returns:
- lifespan of the value
-
getMaxIdle
public long getMaxIdle()
- Specified by:
getMaxIdle
in interfaceInternalCacheValue
- Returns:
- max idle time allowed
-
getExpiryTime
public long getExpiryTime()
- Specified by:
getExpiryTime
in interfaceInternalCacheValue
-
getMetadata
public Metadata getMetadata()
- Specified by:
getMetadata
in interfaceInternalCacheValue
-
clone
public ImmortalCacheValue clone()
-
-