Package org.cis1200

Enum Class ErrorCode

java.lang.Object
java.lang.Enum<ErrorCode>
org.cis1200.ErrorCode
All Implemented Interfaces:
Serializable, Comparable<ErrorCode>, Constable

public enum ErrorCode extends Enum<ErrorCode>
ErrorCode is an enumerated type (enum) that lists all possible response codes a server can send to a client in the case of an erroneous command. Each response has both a string and int representation. You do not need to modify this file.
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    Response by the server when a client attempts to create a channel whose name is already used by another channel on the server.
    Response by the server when a user tries to change his/her nickname to an invalid string.
    Response by the server when a client attempts to issue an invitation to a channel that is not invite-only.
    Response by the server when a client attempts to join a channel to which he or she has not been invited.
    Response by the server when a client attempts to change his or her nick to a nickname that is already in use by another user.
    Response by the server when the channel specified in a command is not recognized by the server.
    Response by the server when the target specified in the command is not registered on the server.
    Response by the server when a client attempts to send a command requiring the sender to be in the specified channel to a channel in which he or she is not a member.
    Response by the server when a client which does not own a channel attempts to send a command that is restricted to the owner; currently, the only such command is KICK.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
     
    static ErrorCode
    Returns the enum constant of this class with the specified name.
    static ErrorCode[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • INVALID_NAME

      public static final ErrorCode INVALID_NAME
      Response by the server when a user tries to change his/her nickname to an invalid string.
    • NO_SUCH_CHANNEL

      public static final ErrorCode NO_SUCH_CHANNEL
      Response by the server when the channel specified in a command is not recognized by the server.
    • NO_SUCH_USER

      public static final ErrorCode NO_SUCH_USER
      Response by the server when the target specified in the command is not registered on the server.
    • USER_NOT_IN_CHANNEL

      public static final ErrorCode USER_NOT_IN_CHANNEL
      Response by the server when a client attempts to send a command requiring the sender to be in the specified channel to a channel in which he or she is not a member.
    • USER_NOT_OWNER

      public static final ErrorCode USER_NOT_OWNER
      Response by the server when a client which does not own a channel attempts to send a command that is restricted to the owner; currently, the only such command is KICK.
    • JOIN_PRIVATE_CHANNEL

      public static final ErrorCode JOIN_PRIVATE_CHANNEL
      Response by the server when a client attempts to join a channel to which he or she has not been invited.
    • INVITE_TO_PUBLIC_CHANNEL

      public static final ErrorCode INVITE_TO_PUBLIC_CHANNEL
      Response by the server when a client attempts to issue an invitation to a channel that is not invite-only.
    • NAME_ALREADY_IN_USE

      public static final ErrorCode NAME_ALREADY_IN_USE
      Response by the server when a client attempts to change his or her nick to a nickname that is already in use by another user.
    • CHANNEL_ALREADY_EXISTS

      public static final ErrorCode CHANNEL_ALREADY_EXISTS
      Response by the server when a client attempts to create a channel whose name is already used by another channel on the server.
  • Method Details

    • values

      public static ErrorCode[] 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 ErrorCode 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 int getCode()
      Returns:
      the code associated with this response.