Package net.dv8tion.jda.api.requests
Enum CloseCode
- All Implemented Interfaces:
Serializable
,Comparable<CloseCode>
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
-
Enum Constant Summary
Enum ConstantDescription -
Method Summary
Modifier and TypeMethodDescriptionstatic CloseCode
from
(int code) Retrieves the CloseCode representation for the specified integer close codeint
getCode()
The integer code in the form of4xxx
/1xxx
The message which further explains the reason for this close code's occurrenceboolean
Whether the gateway client will attempt to reconnect when this close code appearstoString()
static CloseCode
Returns the enum constant of this type with the specified name.static CloseCode[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
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 type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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 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
null
if no match was found
-