public abstract class Command<T>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.Object |
VOID_RESPONSE |
Constructor and Description |
---|
Command() |
Modifier and Type | Method and Description |
---|---|
abstract java.lang.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 abstract java.lang.String getName()
public abstract void writeBody(CommandSender sender) throws java.io.IOException
sender
- the sender used to send the command.java.io.IOException
- if an I/O error occurs.public void readResponse(CommandReader reader) throws java.io.IOException
java.io.IOException
protected abstract T readResponseInternal(CommandReader reader) throws java.io.IOException
reader
- the reader used to read the response.java.io.IOException
- if an I/O error occurs.@Nullable public T getResponse()
public boolean isResponseReceived()