TSK-1285: added constant in TaskState so that endStates can be used in combination with our queries
This commit is contained in:
parent
f749c8d272
commit
fe0ce092fe
|
@ -10,11 +10,13 @@ public enum TaskState {
|
|||
CANCELLED,
|
||||
TERMINATED;
|
||||
|
||||
public static final TaskState[] END_STATES = {COMPLETED, CANCELLED, TERMINATED};
|
||||
|
||||
public boolean in(TaskState... states) {
|
||||
return Arrays.stream(states).anyMatch(state -> state == this);
|
||||
}
|
||||
|
||||
public boolean isEndState() {
|
||||
return this == COMPLETED || this == CANCELLED || this == TERMINATED;
|
||||
return in(END_STATES);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue