Enum Class Errors

java.lang.Object
java.lang.Enum<Errors>
it.meucci.commands.Errors
All Implemented Interfaces:
Serializable, Comparable<Errors>, Constable

public enum Errors extends Enum<Errors>
There errors are the ones the program issue when the user type an error wrongly.
  • Enum Constant Details

    • COMMAND_NOT_RECOGNIZED

      public static final Errors COMMAND_NOT_RECOGNIZED
      The error is not recognized amoung CommandType
    • WRONG_ARGS

      public static final Errors WRONG_ARGS
      The error is recognized but the right arguments were not provided
  • Method Details

    • values

      public static Errors[] 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 Errors 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
    • humanizeError

      public static String humanizeError(Errors e)
      As per Messages, errors also needs to be displayed correctly. For the same reasons as messages, a toString implementation was not used because we wanted to reserve it for debug purpuses.
      Parameters:
      e - The error to be displayed
      Returns:
      A ready to be displayed string