Interface OffsetValue<V>
-
- Type Parameters:
V- the value type
- All Known Implementing Classes:
OffsetValue.DefaultOffsetValue,OffsetValue.DurationOffsetValue,OffsetValue.InstantOffsetValue,OffsetValue.TemporalOffsetValue
public interface OffsetValue<V> extends Value<V>
Encapsulates a value that is offset from some basis, and updated viaValue.set(Object).- Author:
- Paul Ferraro
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classOffsetValue.DefaultOffsetValue<O,V>static classOffsetValue.DurationOffsetValuestatic classOffsetValue.InstantOffsetValuestatic classOffsetValue.TemporalOffsetValue<V>-
Nested classes/interfaces inherited from interface org.wildfly.clustering.ee.cache.offset.Value
Value.AbstractValue<V>
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static OffsetValue<Duration>from(Duration duration)static OffsetValue<Instant>from(Instant instant)default Vget()Returns the current value, computed by applying the current offset to the basis.VgetBasis()Returns the basis from which the associated offset will be applied.Offset<V>getOffset()The current offset.OffsetValue<V>rebase()Returns a new offset value based on the current value.default voidsetOffset(Offset<V> offset)Sets the current offset.
-
-
-
Method Detail
-
getBasis
V getBasis()
Returns the basis from which the associated offset will be applied.- Returns:
- the basis from which the associated offset will be applied.
-
get
default V get()
Returns the current value, computed by applying the current offset to the basis.
-
setOffset
default void setOffset(Offset<V> offset)
Sets the current offset.- Parameters:
offset- an offset
-
rebase
OffsetValue<V> rebase()
Returns a new offset value based on the current value.- Returns:
- a new offset value
-
from
static OffsetValue<Duration> from(Duration duration)
-
from
static OffsetValue<Instant> from(Instant instant)
-
-