public class MethodPacket extends InteractivePacket
MethodPacket
represents a request for the recipient (which could either be the Interactive service
or a client) to perform an action. The action varies depending on the InteractiveMethod
that was the
subject of the request.InteractiveMethod
,
ReplyPacket
Constructor and Description |
---|
MethodPacket(int id,
InteractiveMethod method,
com.google.gson.JsonElement params)
Initializes a new
MethodPacket . |
MethodPacket(int id,
InteractiveMethod method,
com.google.gson.JsonElement params,
Boolean discard)
Initializes a new
MethodPacket . |
MethodPacket(int id,
String method,
com.google.gson.JsonElement params)
Initializes a new
MethodPacket . |
MethodPacket(int id,
String method,
com.google.gson.JsonElement params,
Boolean discard)
Initializes a new
MethodPacket . |
Modifier and Type | Method and Description |
---|---|
boolean |
getDiscard()
Returns whether or not this request can be discarded (a reply is not required).
|
InteractiveMethod |
getMethod()
Retrieves the
InteractiveMethod to call on the Interactive service. |
String |
getMethodName()
Retrieves the method name to call on the Interactive service.
|
com.google.gson.JsonElement |
getRequestParameters()
Retrieves the parameters for the request.
|
getPacketID, getSequenceNumber, getType, setSequenceNumber
public MethodPacket(int id, InteractiveMethod method, com.google.gson.JsonElement params)
MethodPacket
.id
- Numeric identifier for this packetmethod
- The name of the method to call on the Interactive serviceparams
- An object of named arguments to pass as parameters to the Interactive servicepublic MethodPacket(int id, String method, com.google.gson.JsonElement params)
MethodPacket
.id
- Numeric identifier for this packetmethod
- The name of the method to call on the Interactive serviceparams
- An object of named arguments to pass as parameters to the Interactive servicepublic MethodPacket(int id, InteractiveMethod method, com.google.gson.JsonElement params, Boolean discard)
MethodPacket
.id
- Numeric identifier for this packetmethod
- The name of the method to call on the Interactive serviceparams
- An object of named arguments to pass as parameters to the Interactive servicediscard
- true
if this request can be discarded (a reply is not required), false
otherwisepublic MethodPacket(int id, String method, com.google.gson.JsonElement params, Boolean discard)
MethodPacket
.id
- Numeric identifier for this packetmethod
- The name of the method to call on the Interactive serviceparams
- An object of named arguments to pass as parameters to the Interactive servicediscard
- true
if this request can be discarded (a reply is not required), false
otherwisepublic InteractiveMethod getMethod()
InteractiveMethod
to call on the Interactive service.InteractiveMethod
to call on the Interactive servicepublic String getMethodName()
public com.google.gson.JsonElement getRequestParameters()
public boolean getDiscard()
true
if this request can be discarded (a reply is not required), false
otherwiseCopyright © 2018. All rights reserved.