Package ej.rcommand.synchronous
Class Command<T>
- java.lang.Object
-
- ej.rcommand.synchronous.Command<T>
-
- Direct Known Subclasses:
AddServiceCommand,ConnectCommand,DisableCommand,DisconnectCommand,DiscoverServicesCommand,EnableCommand,PollEventCommand,SendExecuteWriteResponseCommand,SendNotificationCommand,SendPairRequestCommand,SendPairResponseCommand,SendPasskeyResponseCommand,SendPrepareWriteResponseCommand,SendReadRequestCommand,SendReadResponseCommand,SendWriteRequestCommand,SendWriteResponseCommand,StartAdvertisingCommand,StartScanningCommand,StopAdvertisingCommand,StopScanningCommand
public abstract class Command<T> extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static ObjectVOID_RESPONSE
-
Constructor Summary
Constructors Constructor Description Command()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract StringgetName()TgetResponse()booleanisResponseReceived()voidreadResponse(CommandReader reader)protected abstract TreadResponseInternal(CommandReader reader)Reads and returns the response from the reader.abstract voidwriteBody(CommandSender sender)Writes the body of the command.
-
-
-
Field Detail
-
VOID_RESPONSE
public static final Object VOID_RESPONSE
-
-
Method Detail
-
getName
public abstract String getName()
-
writeBody
public abstract void writeBody(CommandSender sender) throws IOException
Writes the body of the command.- Parameters:
sender- the sender used to send the command.- Throws:
IOException- if an I/O error occurs.
-
readResponse
public void readResponse(CommandReader reader) throws IOException
- Throws:
IOException
-
readResponseInternal
protected abstract T readResponseInternal(CommandReader reader) throws IOException
Reads and returns the response from the reader.- Parameters:
reader- the reader used to read the response.- Returns:
- the response.
- Throws:
IOException- if an I/O error occurs.
-
isResponseReceived
public boolean isResponseReceived()
-
-