public enum FrameType extends Enum<FrameType>
FrameType
represents the set of opcodes defined
in RFC 6455. The base framing protocol uses a opcode to define the
interpretation of the payload data for the frame.Frame
Enum Constant and Description |
---|
BINARY
A binary frame identifies a message that contains binary data.
|
CLOSE
A close frame identifies a frame used to terminate a connection.
|
CONTINUATION
A continuation frame identifies a fragment from a larger message.
|
PING
A ping frame is a heartbeat used to determine connection health.
|
PONG
A pong frame is sent is sent in response to a ping frame.
|
TEXT
A text frame identifies a message that contains UTF-8 text data.
|
Modifier and Type | Field and Description |
---|---|
int |
code
This is the integer value for the opcode.
|
Modifier and Type | Method and Description |
---|---|
boolean |
isClose()
This is used to determine if a frame is a close frame.
|
boolean |
isPing()
This is used to determine if a frame is a ping frame.
|
boolean |
isPong()
This is used to determine if a frame is a pong frame.
|
boolean |
isText()
This is used to determine if a frame is a text frame.
|
static FrameType |
resolveType(int octet)
This is used to acquire the frame type given an opcode.
|
static FrameType |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static FrameType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final FrameType CONTINUATION
public static final FrameType TEXT
public static final FrameType BINARY
public static final FrameType CLOSE
public static final FrameType PING
public static final FrameType PONG
public static FrameType[] values()
for (FrameType c : FrameType.values()) System.out.println(c);
public static FrameType valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic boolean isText()
public boolean isClose()
public boolean isPong()
public boolean isPing()
public static FrameType resolveType(int octet)
octet
- this is the octet representing the opcodeCopyright © 2023. All rights reserved.