public abstract class Command<T> extends Object
| Modifier and Type | Field and Description |
|---|---|
static Object |
VOID_RESPONSE |
| Constructor and Description |
|---|
Command() |
| Modifier and Type | Method and Description |
|---|---|
abstract String |
getName() |
T |
getResponse() |
boolean |
isResponseReceived() |
void |
readResponse(CommandReader reader) |
protected abstract T |
readResponseInternal(CommandReader reader)
Reads and returns the response from the reader.
|
abstract void |
writeBody(CommandSender sender)
Writes the body of the command.
|
public static final Object VOID_RESPONSE
public abstract String getName()
public boolean isResponseReceived()
public void readResponse(CommandReader reader) throws IOException
IOExceptionprotected abstract T readResponseInternal(CommandReader reader) throws IOException
reader - the reader used to read the response.IOException - if an I/O error occurs.public abstract void writeBody(CommandSender sender) throws IOException
sender - the sender used to send the command.IOException - if an I/O error occurs.