| Modifier and Type | Class and Description |
|---|---|
static class |
State.InvalidStateException |
static interface |
State.StateChangeListener<T extends Enum> |
| Constructor and Description |
|---|
State(T initialState)
Create a new state
|
| Modifier and Type | Method and Description |
|---|---|
void |
addStateChangeListener(State.StateChangeListener<T> listener) |
void |
checkState(T... states)
Check the state and generate an exception if the current state does not
match.
|
Class<T> |
getEnumClass() |
T |
getState() |
boolean |
isInState(T state) |
void |
removeStateChangeListener(State.StateChangeListener<T> listener) |
void |
setState(T state)
Changes the current state.
|
String |
toString() |
public State(T initialState)
initialState - Initial statepublic void setState(T state)
state - The new statepublic T getState()
public boolean isInState(T state)
public void addStateChangeListener(State.StateChangeListener<T> listener)
public void removeStateChangeListener(State.StateChangeListener<T> listener)
public void checkState(T... states) throws State.InvalidStateException
states - The expected state, may be a list of possible statesState.InvalidStateException - If the state does not match.Copyright © 2021 LSST. All rights reserved.