public static enum Lifecyclable.State extends Enum<Lifecyclable.State>
Lifecyclable
is defined by the enum constants.
Transition from one state to another must only be made sequentially in
strict ordinal order using the nextState()
method or an
equivalent.Enum Constant and Description |
---|
CREATED
The
Lifecyclable has been created but no Lifecyclable
methods has been called on it yet. |
INIITIALIZED
The
Lifecyclable has been initialized. |
LOADED
The
Lifecyclable has been initialized and loaded. |
RESOLVED
The
Lifecyclable has been initialized, loaded and resolved. |
STARTED
The
Lifecyclable has been initialized, loaded, resolved and
started. |
STOPPED
The
Lifecyclable has been initialized, loaded, resolved,
started and stopped. |
Modifier and Type | Method and Description |
---|---|
void |
checkNextState(Lifecyclable.State nextState)
Asserts that the specified state is the correct next one.
|
Optional<Lifecyclable.State> |
nextState()
Returns the next
State after this, if any. |
boolean |
onOrAfter(Lifecyclable.State compareToState)
Returns if this State is on or after the provided state.
|
static Lifecyclable.State |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Lifecyclable.State[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Lifecyclable.State CREATED
Lifecyclable
has been created but no Lifecyclable
methods has been called on it yet.public static final Lifecyclable.State INIITIALIZED
Lifecyclable
has been initialized.
The following method(s) has been called and has completed on the
Lifecyclable
:
public static final Lifecyclable.State LOADED
Lifecyclable
has been initialized and loaded.
The following method(s) has been called and has completed on the
Lifecyclable
:
public static final Lifecyclable.State RESOLVED
Lifecyclable
has been initialized, loaded and resolved.
The following method(s) has been called and has completed on the
Lifecyclable
:
public static final Lifecyclable.State STARTED
Lifecyclable
has been initialized, loaded, resolved and
started.
The following method(s) has been called and has completed on the
Lifecyclable
:
public static final Lifecyclable.State STOPPED
Lifecyclable
has been initialized, loaded, resolved,
started and stopped.
The following method(s) has been called and has completed on the
Lifecyclable
:
public static Lifecyclable.State[] values()
for (Lifecyclable.State c : Lifecyclable.State.values()) System.out.println(c);
public static Lifecyclable.State valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic void checkNextState(Lifecyclable.State nextState)
IllegalStateException
is thrown.nextState
- the proposed next statepublic Optional<Lifecyclable.State> nextState()
State
after this, if any. If there is no
following State
, an empty optional is returned.State
or empty if there is nonepublic boolean onOrAfter(Lifecyclable.State compareToState)
compareToState
- the State
to compare this withCopyright © 2016 Speedment, Inc.. All rights reserved.