public class SimpleExpiringValue<V> extends ExpiringValue<V>
| Constructor and Description |
|---|
SimpleExpiringValue(long valueTimeout) |
SimpleExpiringValue(V value,
long valueTimeout) |
| Modifier and Type | Method and Description |
|---|---|
protected long |
getExpireTime()
Gets the absolute time at which the current value is no longer valid.
|
protected long |
getTimeout()
Gets the configured relative expire timeout for values cached by this instance.
|
boolean |
isValid(V curValue)
Returns
true if the expire time is greater than the current time, false otherwise. |
void |
set(V value)
Sets the current value
|
protected void |
updateExpireTime()
Updates the expire time to the current time plus the configured timeout
|
getpublic SimpleExpiringValue(long valueTimeout)
public SimpleExpiringValue(V value, long valueTimeout)
protected long getTimeout()
protected long getExpireTime()
protected void updateExpireTime()
public void set(V value)
Updates the expiration time via updateExpireTime() if the new value is non-null.
set in class ExpiringValue<V>public boolean isValid(V curValue)
true if the expire time is greater than the current time, false otherwise.isValid in class ExpiringValue<V>