T - The state value type.public interface State<T>
StateValueHost and a StateValue.
A state has a unique id that's passed on to any value defined from it, a state does not keep any data other than its id, who keeps it is the state value. A state id is needed to access a state value within a value host.
MutableState| Modifier and Type | Field and Description |
|---|---|
static java.util.concurrent.atomic.AtomicLong |
ids |
| Modifier and Type | Method and Description |
|---|---|
StateValueFactory |
factory()
The value factory of this state.
|
T |
get(@NotNull StateValueHost host)
Gets the current value for this state defined in the specified host.
|
long |
internalId()
Returns the internal unique id of this state.
|
static long |
next()
Generates a new state id.
|
T get(@NotNull @NotNull StateValueHost host)
host - The state host.@ApiStatus.Internal StateValueFactory factory()
This is an internal inventory-framework API that should not be used from outside of this library. No compatibility guarantees are provided.
@ApiStatus.Internal long internalId()
This is an internal inventory-framework API that should not be used from outside of this library. No compatibility guarantees are provided.
static long next()