Enum ServerError

All Implemented Interfaces:
Serializable, Comparable<ServerError>, java.lang.constant.Constable

public enum ServerError
extends Enum<ServerError>
ServerError is an enumerated type that lists all possible response codes a server can send to a client. Each response has both a string and integer 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
    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.
    INVALID_NAME
    Response by the server when a user tries to change his/her nickname to an invalid string.
    INVITE_TO_PUBLIC_CHANNEL
    Response by the server when a client attempts to issue an invite to a channel that is not invite-only.
    JOIN_PRIVATE_CHANNEL
    Response by the server when a client attempts to join a channel to which he or she has not been invited.
    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.
    NO_SUCH_CHANNEL
    Response by the server when the channel specified in a command is not recognized by the server.
    NO_SUCH_USER
    Response by the server when the target specified in the command is not registered on the server.
    OKAY
    Response indicating no error has occurred.
    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
    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 getCode()  
    static ServerError valueOf​(String name)
    Returns the enum constant of this type with the specified name.
    static ServerError[] values()
    Returns an array containing the constants of this enum type, in the order they are declared.

    Methods inherited from class java.lang.Object

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

    • OKAY

      public static final ServerError OKAY
      Response indicating no error has occurred.
    • INVALID_NAME

      public static final ServerError 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 ServerError 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 ServerError 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 ServerError 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 ServerError 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 ServerError 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 ServerError INVITE_TO_PUBLIC_CHANNEL
      Response by the server when a client attempts to issue an invite to a channel that is not invite-only.
    • NAME_ALREADY_IN_USE

      public static final ServerError 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 ServerError 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 ServerError[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static ServerError valueOf​(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified name
      NullPointerException - if the argument is null
    • getCode

      public int getCode()