Enum Class ErrorType
- All Implemented Interfaces:
Serializable, Comparable<ErrorType>, Constable
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe game has already started and cannot accept new players.A generic, unclassified error occurred.The chosen username is already taken by another connected player.The server has crashed or become unreachable.The server is unreachable.The user is already connected to the server.The action attempted is not valid in the current game state.The requested number of players is outside the allowed range. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final StringHuman-readable description of this error, returned bytoString(). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiontoString()Returns the human-readable description of this error.static ErrorTypeReturns the enum constant of this class with the specified name.static ErrorType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
INVALID_USERNAME
The chosen username is already taken by another connected player. -
USER_ALREADY_CONNECTED
The user is already connected to the server. -
WRONG_PLAYER_NUMBER
The requested number of players is outside the allowed range. -
SERVER_CRASHED
The server has crashed or become unreachable. -
SERVER_UNREACHABLE
The server is unreachable. -
GENERIC_ERROR
A generic, unclassified error occurred. -
GAME_ALREADY_STARTED
The game has already started and cannot accept new players. -
WRONG_ACTION
The action attempted is not valid in the current game state.
-
-
Field Details
-
description
Human-readable description of this error, returned bytoString().
-
-
Constructor Details
-
ErrorType
Creates an error type constant with the given human-readable description.- Parameters:
description- the message returned bytoString().
-
-
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
-
toString
-