public abstract class ExpiringValue<V> extends Object
null
.
This class is not thread-safe. The expectation is that subtypes of this class will be used within a ConnectorCache instance which manages the thread-safety.
Constructor and Description |
---|
ExpiringValue() |
ExpiringValue(V value) |
Modifier and Type | Method and Description |
---|---|
V |
get()
Gets the current, valid value,
null otherwise. |
abstract boolean |
isValid(V curValue)
Returns
true if the given value is still valid, false otherwise. |
void |
set(V value)
Sets the current value
|
public ExpiringValue()
public ExpiringValue(V value)
public V get()
null
otherwise. If the current value is not valid, it will be cleared by
this call before returning.public void set(V value)
public abstract boolean isValid(V curValue)
true
if the given value is still valid, false
otherwise.