Enum Class ResponseStatus
- All Implemented Interfaces:
Serializable,Comparable<ResponseStatus>,Constable
Describes the outcome of an
effect-request.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe effect could not be applied instantly but is expecting to apply soon.The effect failed to execute and should never be requested again (at least for this session).The effect failed to execute but may work another time.The non-timed effect executed successfully.The timed effect began successfully.The timed effect has ended.The timed effect has been paused.The timed effect has been resumed.The JSON-specified value could not be decoded. -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull ResponseStatusGets a status from its JSON string value.@NotNull StringgetValue()Gets the encoded string value of this status.booleanGets whether this status represents a terminating status.booleanisTimed()Gets whether this status represents a timed status.toString()static ResponseStatusReturns the enum constant of this class with the specified name.static ResponseStatus[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
SUCCESS
The non-timed effect executed successfully. -
FAIL_TEMPORARY
The effect failed to execute but may work another time. -
FAIL_PERMANENT
The effect failed to execute and should never be requested again (at least for this session). -
DELAY_ESTIMATED
The effect could not be applied instantly but is expecting to apply soon. This is currently unused. -
TIMED_BEGIN
The timed effect began successfully. -
TIMED_PAUSE
The timed effect has been paused. -
TIMED_RESUME
The timed effect has been resumed. -
TIMED_END
The timed effect has ended. -
UNKNOWN
The JSON-specified value could not be decoded.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException- if the argument is null
-
fromValue
Gets a status from its JSON string value. If a status by the provided name could not be found, returnsUNKNOWN.- Parameters:
value- JSON string value- Returns:
- result status value
-
getValue
Gets the encoded string value of this status.- Returns:
- json value
-
isTimed
public boolean isTimed()Gets whether this status represents a timed status. A timed status is required to useCCTimedEffectResponse, while non-timed statuses are required to useCCInstantEffectResponse.- Returns:
- is timed status
-
isTerminating
public boolean isTerminating()Gets whether this status represents a terminating status. A terminating status is one that finalizes whether an effect should consume or refund coins.- Returns:
- is terminating status
-
toString
- Overrides:
toStringin classEnum<ResponseStatus>
-