public abstract class AbstractValueHolder<V> extends java.lang.Object implements Store.ValueHolder<V>
NO_EXPIRE| Modifier | Constructor and Description |
|---|---|
protected |
AbstractValueHolder(long id,
long creationTime) |
protected |
AbstractValueHolder(long id,
long creationTime,
long expirationTime) |
| Modifier and Type | Method and Description |
|---|---|
void |
accessed(long now,
java.time.Duration expiration) |
long |
creationTime()
Accessor to the creation time of this ValueHolder
|
boolean |
equals(java.lang.Object obj) |
long |
expirationTime()
Accessor to the expiration time of this ValueHolder
|
long |
getId()
The combination of this identifier and the
key that ValueHolder is mapped to should to be
unique at a given time. |
int |
hashCode() |
boolean |
isExpired(long expirationTime)
Check if the ValueHolder is expired relative to the specified time
|
long |
lastAccessTime()
Accessor to the last access time of the Value held in this ValueHolder
|
void |
setExpirationTime(long expirationTime)
Set the new expiration time in milliseconds.
|
void |
setLastAccessTime(long lastAccessTime)
Set the last time this entry was accessed in milliseconds.
|
java.lang.String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitgetprotected AbstractValueHolder(long id,
long creationTime)
protected AbstractValueHolder(long id,
long creationTime,
long expirationTime)
public long creationTime()
Store.ValueHoldercreationTime in interface Store.ValueHolder<V>public void setExpirationTime(long expirationTime)
Store.ValueHolder.NO_EXPIRE if the entry
shouldn't expire.expirationTime - new expiration timepublic void accessed(long now,
java.time.Duration expiration)
public long expirationTime()
Store.ValueHolderexpirationTime in interface Store.ValueHolder<V>Store.ValueHolder.NO_EXPIRE means that the ValueHolder will never expire.public boolean isExpired(long expirationTime)
Store.ValueHolderisExpired in interface Store.ValueHolder<V>expirationTime - the expiration time (in ms) relative to which the expiry check must be madepublic long lastAccessTime()
Store.ValueHolderlastAccessTime in interface Store.ValueHolder<V>public void setLastAccessTime(long lastAccessTime)
lastAccessTime - last time the entry was accessedpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic long getId()
Store.ValueHolderkey that ValueHolder is mapped to should to be
unique at a given time.getId in interface Store.ValueHolder<V>public java.lang.String toString()
toString in class java.lang.Object