Module watamebot

Enum Class ExitCode

java.lang.Object
java.lang.Enum<ExitCode>
net.foxgenesis.watame.ExitCode
All Implemented Interfaces:
Serializable, Comparable<ExitCode>, Constable

public enum ExitCode extends Enum<ExitCode>
Enum of program exit codes
Author:
Ashley
  • Enum Constant Details

    • INSTANCE_ALREADY_RUNNING

      public static final ExitCode INSTANCE_ALREADY_RUNNING
    • RESOURCE_IO_ERROR

      public static final ExitCode RESOURCE_IO_ERROR
    • NO_TOKEN

      public static final ExitCode NO_TOKEN
    • INVALID_TOKEN

      public static final ExitCode INVALID_TOKEN
    • JDA_BUILD_FAIL

      public static final ExitCode JDA_BUILD_FAIL
    • DATABASE_NOT_CONNECTED

      public static final ExitCode DATABASE_NOT_CONNECTED
    • DATABASE_INVALID_SETUP_FILE

      public static final ExitCode DATABASE_INVALID_SETUP_FILE
    • DATABASE_SETUP_ERROR

      public static final ExitCode DATABASE_SETUP_ERROR
    • DATABASE_ACCESS_ERROR

      public static final ExitCode DATABASE_ACCESS_ERROR
    • DATABASE_STATEMENT_MISSING

      public static final ExitCode DATABASE_STATEMENT_MISSING
    • DATABASE_STATEMENT_ERROR

      public static final ExitCode DATABASE_STATEMENT_ERROR
  • Method Details

    • values

      public static ExitCode[] 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

      public static ExitCode valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • getCode

      public Integer getCode()
      Returns the ExitCode's number.
      Returns:
      exit code
    • programExit

      public void programExit(String exitMessage, Throwable thrown)
      Exit the program with a specific message and Throwable.

      The call exitCode.exitProgram(null, null) is effectively equivalent to the call:

       exitCode.exitProgram()
       
      Parameters:
      exitMessage - - Exit message to log
      thrown - - Throwable to log
      See Also:
    • programExit

      public void programExit(Throwable thrown)
      Exit the program with a specific Throwable.

      The call exitCode.exitProgram(thrown) is effectively equivalent to the call:

       exitCode.exitProgram(null, thrown)
       
      Parameters:
      thrown - - Throwable to log
      See Also:
    • programExit

      public void programExit(String exitMessage)
      Exit the program with a specific message.

      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 this ExitCode's "exit code".

      This method is effectively equivalent to the call:

       System.exit(n)
       
      See Also: