DirectMethodPayload Class
- java.
lang. Object - com.
microsoft. azure. sdk. iot. device. twin. DirectMethodPayload
- com.
public class DirectMethodPayload
This class contains the payload of a direct method request that was received by the device/module. It is used with the onMethodInvoked() callback which is executed each time a direct method is invoked.
Method Summary
Modifier and Type | Method and Description |
---|---|
<T> T |
getPayload(Class<T> clazz)
Return the DirectMethodPayload payload in a custom type of your choosing |
JsonElement |
getPayloadAsJsonElement()
Return the DirectMethodPayload payload in JsonElement type |
String |
getPayloadAsJsonString()
Return the DirectMethodPayload payload in json string Use this if you wish to deserialize to a specific type using a deserialization library of your choice |
Method Details
getPayload
public
Return the DirectMethodPayload payload in a custom type of your choosing
Parameters:
Returns:
getPayloadAsJsonElement
public JsonElement getPayloadAsJsonElement()
Return the DirectMethodPayload payload in JsonElement type
Returns:
getPayloadAsJsonString
public String getPayloadAsJsonString()
Return the DirectMethodPayload payload in json string Use this if you wish to deserialize to a specific type using a deserialization library of your choice
Returns:
Applies to
Azure SDK for Java