Package net.dv8tion.jda.api.requests
Enum Class CloseCode
- All Implemented Interfaces:
Serializable,Comparable<CloseCode>,Constable
Constants representing main gateway close codes with association to an explaining message.
This was inspired from the official documentation
This was inspired from the official documentation
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescription -
Method Summary
Modifier and TypeMethodDescriptionstatic CloseCodefrom(int code) Retrieves the CloseCode representation for the specified integer close codeintgetCode()The integer code in the form of4xxx/1xxxThe message which further explains the reason for this close code's occurrencebooleanWhether the gateway client will attempt to reconnect when this close code appearstoString()static CloseCodeReturns the enum constant of this class with the specified name.static CloseCode[]values()Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, valueOf
-
Enum Constant Details
-
RECONNECT
-
GRACEFUL_CLOSE
-
CLOUD_FLARE_LOAD
-
INTERNAL_SERVER_ERROR
-
UNKNOWN_ERROR
-
UNKNOWN_OPCODE
-
DECODE_ERROR
-
NOT_AUTHENTICATED
-
AUTHENTICATION_FAILED
-
ALREADY_AUTHENTICATED
-
INVALID_SEQ
-
RATE_LIMITED
-
SESSION_TIMEOUT
-
INVALID_SHARD
-
SHARDING_REQUIRED
-
INVALID_INTENTS
-
DISALLOWED_INTENTS
-
-
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()The integer code in the form of4xxx/1xxx- Returns:
- The integer representation for this CloseCode
-
getMeaning
The message which further explains the reason for this close code's occurrence- Returns:
- The reason for this close
-
isReconnect
public boolean isReconnect()Whether the gateway client will attempt to reconnect when this close code appears- Returns:
- Whether the WebSocketClient will attempt to reconnect
-
toString
-
from
Retrieves the CloseCode representation for the specified integer close code- Parameters:
code- The close code to match- Returns:
- The CloseCode field matching the specified integer
or
nullif no match was found
-