Package org.dellroad.stuff.java
Enum Class ErrorAction
- All Implemented Interfaces:
Serializable
,Comparable<ErrorAction>
,Constable
Enumeration of possible actions to take when an error of some kind is detected.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionRaise an assertion error (if assertions are enabled).Throw aRuntimeException
.Ignore the error: do nothing.Log the error. -
Method Summary
Modifier and TypeMethodDescriptionabstract void
Take the action appropriate for this instance.static ErrorAction
Returns the enum constant of this class with the specified name.static ErrorAction[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
IGNORE
Ignore the error: do nothing. -
LOG
Log the error. -
ASSERT
Raise an assertion error (if assertions are enabled). -
EXCEPTION
Throw aRuntimeException
.
-
-
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
-
execute
Take the action appropriate for this instance.- Parameters:
message
- a message describing the error- Throws:
AssertionError
- if this instance isASSERT
and assertions are enabledRuntimeException
- if this instance isEXCEPTION
-