public enum ServerError extends Enum<ServerError>
ServerError
is an enumerated type that lists all
possible response codes a server can give to a client.
Each response has both a string and integer representation.
You do not need to modify this file.Enum Constant and 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.
|
Modifier and Type | Method and 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.
|
public static final ServerError OKAY
public static final ServerError INVALID_NAME
public static final ServerError NO_SUCH_CHANNEL
public static final ServerError NO_SUCH_USER
public static final ServerError USER_NOT_IN_CHANNEL
public static final ServerError USER_NOT_OWNER
public static final ServerError JOIN_PRIVATE_CHANNEL
public static final ServerError INVITE_TO_PUBLIC_CHANNEL
public static final ServerError NAME_ALREADY_IN_USE
public static final ServerError CHANNEL_ALREADY_EXISTS
public static ServerError[] values()
for (ServerError c : ServerError.values()) System.out.println(c);
public static ServerError valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic int getCode()