Package org.kiwiproject.beta.concurrent
Enum KiwiFutures.FutureState
- java.lang.Object
-
- java.lang.Enum<KiwiFutures.FutureState>
-
- org.kiwiproject.beta.concurrent.KiwiFutures.FutureState
-
- All Implemented Interfaces:
Serializable,Comparable<KiwiFutures.FutureState>
- Enclosing class:
- KiwiFutures
public static enum KiwiFutures.FutureState extends Enum<KiwiFutures.FutureState>
Represents the state of a Future.- Implementation Note:
- This is a copy of the Future.State enum that was added in JDK 19.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static KiwiFutures.FutureStatevalueOf(String name)Returns the enum constant of this type with the specified name.static KiwiFutures.FutureState[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
RUNNING
public static final KiwiFutures.FutureState RUNNING
The task has not completed.
-
SUCCESS
public static final KiwiFutures.FutureState SUCCESS
The task completed with a result.- See Also:
KiwiFutures.resultNow(Future)
-
FAILED
public static final KiwiFutures.FutureState FAILED
The task completed with an exception.- See Also:
KiwiFutures.exceptionNow(Future)
-
CANCELLED
public static final KiwiFutures.FutureState CANCELLED
The task was cancelled.- See Also:
Future.cancel(boolean)
-
-
Method Detail
-
values
public static KiwiFutures.FutureState[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (KiwiFutures.FutureState c : KiwiFutures.FutureState.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static KiwiFutures.FutureState valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
-