public enum GoalState extends Enum<GoalState> implements Serializable
Enum class representing goal state. Each goal is always in one of the states
INACTIVE
, READY
, RUNNING
, DEACTIVATED
,
FAILED
, ACHIEVED
.
You can compare two GoalState
s for equality with built-in
Enum.equals(Object)
or with faster == operator. This holds even if the
class is deserialized from serialized form.
Enum Constant and Description |
---|
ACHIEVED
Achieved goal state
|
DEACTIVATED
Deactivated goal state
|
FAILED
Failed goal state
|
INACTIVE
Inactive goal state
|
READY
Ready goal state
|
RUNNING
Running goal state
|
Modifier and Type | Field and Description |
---|---|
static Set<GoalState> |
ACTIVE_GOAL_STATES
Set containing active goal states.
|
static Set<GoalState> |
FINISHED_GOAL_STATES
Set containing finished goal states.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canBeActivated()
Returns true if the goal can be activated.
|
abstract boolean |
canBeChangedFromState(GoalState oldState)
Returns true if a goal can change its goal state from
oldState to this state. |
boolean |
canBeChangedToState(GoalState newState)
Returns true if a goal can change its goal state from this state to
newState . |
boolean |
canBeDeactivated()
Returns true if the goal can be deactivated.
|
static GoalState |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static GoalState[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final GoalState INACTIVE
public static final GoalState READY
public static final GoalState RUNNING
public static final GoalState DEACTIVATED
public static final GoalState FAILED
public static final GoalState ACHIEVED
public static final Set<GoalState> FINISHED_GOAL_STATES
public static GoalState[] values()
for (GoalState c : GoalState.values()) System.out.println(c);
public static GoalState 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 boolean canBeActivated()
public boolean canBeDeactivated()
public final boolean canBeChangedToState(GoalState newState)
newState
.newState
- new goal statenewState
.public abstract boolean canBeChangedFromState(GoalState oldState)
oldState
to this state.oldState
- old goal stateoldState
to this state.Copyright © 2007-2020 Whitestein Technologies. All Rights Reserved.