public final class ControlCommand extends Packet
A Control Command is used for several administrative Console tasks. Among other things, this packet type allows you to reset the Console.
This class is not guaranteed to be threadsafe. However, instances of this class will normally only be used in the context of a single thread.
PACKET_HEADER| Constructor and Description |
|---|
ControlCommand()
Overloaded.
|
ControlCommand(ControlCommandType controlCommandType) |
| Modifier and Type | Method and Description |
|---|---|
ControlCommandType |
getControlCommandType()
Returns the type of this Control Command.
|
byte[] |
getData()
Returns the optional data block of the Control Command.
|
PacketType |
getPacketType()
Overridden.
|
int |
getSize()
Overridden.
|
void |
setControlCommandType(ControlCommandType controlCommandType)
Sets the type of this Control Command.
|
void |
setData(byte[] data)
Sets the optional data block of the Control Command.
|
getBytes, getLevel, getStringSize, getThreadId, isThreadSafe, lock, setBytes, setLevel, setThreadSafe, unlockpublic ControlCommand()
public ControlCommand(ControlCommandType controlCommandType)
public int getSize()
public PacketType getPacketType()
getPacketType in class Packetpublic ControlCommandType getControlCommandType()
The type of the Control Command describes the way the Console interprets this packet. Please see the ControlCommandType type for more information.
public void setControlCommandType(ControlCommandType controlCommandType)
The type of the Control Command describes the way the Console interprets this packet. Please see the ControlCommandType type for more information.
If the controlCommandType argument is a null reference a NullPointerException will be thrown.
controlCommandType - The new type of this Control Command packet. Not allowed to be null.NullPointerException - if the controlCommandType argument is null.public byte[] getData()
This method can return null if this Control Command does not contain additional data.
Important: Treat the returned array as read-only. This means, modifying this array in any way is not supported.
public void setData(byte[] data)
Because of the fact that the data block of a Control Command is optional, it is allowed to pass a null reference. Important: Treat the passed array as read-only. This means, modifying this array in any way after passing it to this method is not supported.
data - The new data block of this Control Command. Can be null.Copyright © 2023. All rights reserved.