Enum Class WsOpCode

java.lang.Object
java.lang.Enum<WsOpCode>
io.helidon.websocket.WsOpCode
All Implemented Interfaces:
Serializable, Comparable<WsOpCode>, Constable

public enum WsOpCode extends Enum<WsOpCode>
WebSocket operation code. Each frame has an operation code to easily understand what should be done.
  • Enum Constant Details

    • CONTINUATION

      public static final WsOpCode CONTINUATION
      Continuation frame.
    • TEXT

      public static final WsOpCode TEXT
      Payload frame with text payload.
    • BINARY

      public static final WsOpCode BINARY
      Payload frame with binary payload.
    • CLOSE

      public static final WsOpCode CLOSE
      Close control frame.
    • PING

      public static final WsOpCode PING
      Ping control frame.
    • PONG

      public static final WsOpCode PONG
      Pong control frame.
  • Method Details

    • values

      public static WsOpCode[] 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

      public static WsOpCode valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • get

      public static WsOpCode get(int code)
      Get operation code based on its numeric code.
      Parameters:
      code - code
      Returns:
      operation code for the numeric code
      Throws:
      IllegalArgumentException - in case the code is not valid
    • code

      public int code()
      Numeric code (used in binary frame representation) of this operation code.
      Returns:
      numeric code