Package org.cis1200
Enum Class ErrorCode
- All Implemented Interfaces:
Serializable
,Comparable<ErrorCode>
,Constable
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 ConstantsEnum ConstantDescriptionResponse 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
-
Enum Constant Details
-
INVALID_NAME
Response by the server when a user tries to change his/her nickname to an invalid string. -
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. -
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. -
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
Response by the server when a client attempts to issue an invitation to a channel that is not invite-only. -
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
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
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
public int getCode()- Returns:
- the code associated with this response.
-