- All Implemented Interfaces:
Serializable,Comparable<ExitCode>,Constable
Enum of program exit codes
- Author:
- Ashley
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptiongetCode()Returns theExitCode's number.voidExit the program with thisExitCode's"exit code".voidprogramExit(String exitMessage) Exit the program with a specificmessage.voidprogramExit(String exitMessage, Throwable thrown) Exit the program with a specificmessageandThrowable.voidprogramExit(Throwable thrown) Exit the program with a specificThrowable.static ExitCodeReturns the enum constant of this class with the specified name.static ExitCode[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
INSTANCE_ALREADY_RUNNING
-
RESOURCE_IO_ERROR
-
NO_TOKEN
-
INVALID_TOKEN
-
JDA_BUILD_FAIL
-
DATABASE_NOT_CONNECTED
-
DATABASE_INVALID_SETUP_FILE
-
DATABASE_SETUP_ERROR
-
DATABASE_ACCESS_ERROR
-
DATABASE_STATEMENT_MISSING
-
DATABASE_STATEMENT_ERROR
-
-
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
-
getCode
Returns theExitCode's number.- Returns:
- exit code
-
programExit
Exit the program with a specificmessageandThrowable.The call
exitCode.exitProgram(null, null)is effectively equivalent to the call:exitCode.exitProgram()
- Parameters:
exitMessage- - Exit message to logthrown- - Throwable to log- See Also:
-
programExit
Exit the program with a specificThrowable.The call
exitCode.exitProgram(thrown)is effectively equivalent to the call:exitCode.exitProgram(null, thrown)
- Parameters:
thrown- - Throwable to log- See Also:
-
programExit
Exit the program with a specificmessage.The call
exitCode.exitProgram(message)is effectively equivalent to the call:exitCode.exitProgram(message, null)
- Parameters:
exitMessage- - Exit message to log- See Also:
-
programExit
public void programExit()Exit the program with thisExitCode's"exit code".This method is effectively equivalent to the call:
System.exit(n)
- See Also:
-