public class Packet
extends java.lang.Object
IPCClient
.IPCListener
.Modifier and Type | Class and Description |
---|---|
static class |
Packet.OpCode
Discord response OpCode values that are sent with response data to and from
Discord and the
IPCClient connected. |
Constructor and Description |
---|
Packet(Packet.OpCode op,
JSONObject data)
Constructs a new Packet using an
Packet.OpCode and JSONObject . |
Modifier and Type | Method and Description |
---|---|
JSONObject |
getJson()
Gets the
JSONObject value as a part of this Packet . |
Packet.OpCode |
getOp()
Gets the
Packet.OpCode value of this Packet . |
byte[] |
toBytes()
Converts this
Packet to a byte array. |
java.lang.String |
toString() |
public Packet(Packet.OpCode op, JSONObject data)
Packet.OpCode
and JSONObject
.op
- The OpCode value of this new Packet.data
- The JSONObject payload of this new Packet.public byte[] toBytes()
Packet
to a byte
array.byte
array.public Packet.OpCode getOp()
Packet.OpCode
value of this Packet
.public JSONObject getJson()
JSONObject
value as a part of this Packet
.public java.lang.String toString()
toString
in class java.lang.Object