Package org.javacord.core.util.gateway
Enum VoiceGatewayOpcode
- java.lang.Object
-
- java.lang.Enum<VoiceGatewayOpcode>
-
- org.javacord.core.util.gateway.VoiceGatewayOpcode
-
- All Implemented Interfaces:
Serializable
,Comparable<VoiceGatewayOpcode>
public enum VoiceGatewayOpcode extends Enum<VoiceGatewayOpcode>
An enum with all voice gateway opcode as defined by Discord.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description CLIENT_DISCONNECT
a client has disconnected from the voice channel.HEARTBEAT
keep the websocket connection alive.HEARTBEAT_ACK
sent immediately following a received client heartbeat.HELLO
the continuous interval in milliseconds after which the client should send a heartbeat.IDENTIFY
begin a voice websocket connection.READY
complete the websocket handshake.RESUME
resume a connection.RESUMED
acknowledge Resume.SELECT_PROTOCOL
select the voice protocol.SESSION_DESCRIPTION
describe the session.SPEAKING
indicate which users are speaking.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Optional<VoiceGatewayOpcode>
fromCode(int code)
Gets the voice gateway opcode by actual numeric code.int
getCode()
Gets the actual numeric code.static VoiceGatewayOpcode
valueOf(String name)
Returns the enum constant of this type with the specified name.static VoiceGatewayOpcode[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
IDENTIFY
public static final VoiceGatewayOpcode IDENTIFY
begin a voice websocket connection.
-
SELECT_PROTOCOL
public static final VoiceGatewayOpcode SELECT_PROTOCOL
select the voice protocol.
-
READY
public static final VoiceGatewayOpcode READY
complete the websocket handshake.
-
HEARTBEAT
public static final VoiceGatewayOpcode HEARTBEAT
keep the websocket connection alive.
-
SESSION_DESCRIPTION
public static final VoiceGatewayOpcode SESSION_DESCRIPTION
describe the session.
-
SPEAKING
public static final VoiceGatewayOpcode SPEAKING
indicate which users are speaking.
-
HEARTBEAT_ACK
public static final VoiceGatewayOpcode HEARTBEAT_ACK
sent immediately following a received client heartbeat.
-
RESUME
public static final VoiceGatewayOpcode RESUME
resume a connection.
-
HELLO
public static final VoiceGatewayOpcode HELLO
the continuous interval in milliseconds after which the client should send a heartbeat.
-
RESUMED
public static final VoiceGatewayOpcode RESUMED
acknowledge Resume.
-
CLIENT_DISCONNECT
public static final VoiceGatewayOpcode CLIENT_DISCONNECT
a client has disconnected from the voice channel.
-
-
Method Detail
-
values
public static VoiceGatewayOpcode[] 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 (VoiceGatewayOpcode c : VoiceGatewayOpcode.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static VoiceGatewayOpcode 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
-
fromCode
public static Optional<VoiceGatewayOpcode> fromCode(int code)
Gets the voice gateway opcode by actual numeric code.- Parameters:
code
- The actual numeric code.- Returns:
- The voice gateway opcode with the actual numeric code.
-
getCode
public int getCode()
Gets the actual numeric code.- Returns:
- The actual numeric code.
-
-