Enum VoiceGatewayOpcode

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<VoiceGatewayOpcode>

    public enum VoiceGatewayOpcode
    extends java.lang.Enum<VoiceGatewayOpcode>
    An enum with all voice gateway opcode as defined by Discord.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      CLIENT_CONNECT
      a client connected to the voice channel.
      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 java.util.Optional<VoiceGatewayOpcode> fromCode​(int code)
      Gets the voice gateway opcode by actual numeric code.
      int getCode()
      Gets the actual numeric code.
      static VoiceGatewayOpcode valueOf​(java.lang.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.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • IDENTIFY

        public static final VoiceGatewayOpcode IDENTIFY
        begin a voice websocket connection.

        Sent by client

      • SELECT_PROTOCOL

        public static final VoiceGatewayOpcode SELECT_PROTOCOL
        select the voice protocol.

        Sent by client

      • READY

        public static final VoiceGatewayOpcode READY
        complete the websocket handshake.

        Sent by server

      • HEARTBEAT

        public static final VoiceGatewayOpcode HEARTBEAT
        keep the websocket connection alive.

        Sent by client

      • SESSION_DESCRIPTION

        public static final VoiceGatewayOpcode SESSION_DESCRIPTION
        describe the session.

        Sent by server

      • SPEAKING

        public static final VoiceGatewayOpcode SPEAKING
        indicate which users are speaking.

        Sent by client and server

      • HEARTBEAT_ACK

        public static final VoiceGatewayOpcode HEARTBEAT_ACK
        sent immediately following a received client heartbeat.

        Sent by server

      • RESUME

        public static final VoiceGatewayOpcode RESUME
        resume a connection.

        Sent by client

      • HELLO

        public static final VoiceGatewayOpcode HELLO
        the continuous interval in milliseconds after which the client should send a heartbeat.

        Sent by server

      • RESUMED

        public static final VoiceGatewayOpcode RESUMED
        acknowledge Resume.

        Sent by server

      • CLIENT_CONNECT

        public static final VoiceGatewayOpcode CLIENT_CONNECT
        a client connected to the voice channel.

        Sent by server

      • CLIENT_DISCONNECT

        public static final VoiceGatewayOpcode CLIENT_DISCONNECT
        a client has disconnected from the voice channel.

        Sent by server

    • 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​(java.lang.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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • fromCode

        public static java.util.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.