Package org.javacord.core.util.gateway
Enum WebSocketCloseReason
- java.lang.Object
-
- java.lang.Enum<WebSocketCloseReason>
-
- org.javacord.core.util.gateway.WebSocketCloseReason
-
- All Implemented Interfaces:
Serializable
,Comparable<WebSocketCloseReason>
public enum WebSocketCloseReason extends Enum<WebSocketCloseReason>
An enum with all different web socket close reasons.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description COMMANDED_RECONNECT
DISCONNECT
HEARTBEAT_NOT_PROPERLY_ANSWERED
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getCloseReason()
Gets the close reason.int
getNumericCloseCode()
Gets the actual numeric close code.static WebSocketCloseReason
valueOf(String name)
Returns the enum constant of this type with the specified name.static WebSocketCloseReason[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
DISCONNECT
public static final WebSocketCloseReason DISCONNECT
-
HEARTBEAT_NOT_PROPERLY_ANSWERED
public static final WebSocketCloseReason HEARTBEAT_NOT_PROPERLY_ANSWERED
-
COMMANDED_RECONNECT
public static final WebSocketCloseReason COMMANDED_RECONNECT
-
-
Method Detail
-
values
public static WebSocketCloseReason[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (WebSocketCloseReason c : WebSocketCloseReason.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static WebSocketCloseReason valueOf(String name)
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
-
getNumericCloseCode
public int getNumericCloseCode()
Gets the actual numeric close code.- Returns:
- The actual numeric close code.
-
getCloseReason
public String getCloseReason()
Gets the close reason.- Returns:
- The close reason.
-
-