DirectMethodResponse Class

  • java.lang.Object
    • com.microsoft.azure.sdk.iot.service.methods.DirectMethodResponse

public class DirectMethodResponse

Store the status and payload received as result of a method invoke.

Constructor Summary

Constructor Description
DirectMethodResponse(Integer status, JsonElement payload)

Method Summary

Modifier and Type Method and Description
<T> T getPayload(Class<T> clazz)

Return the DirectMethodResponse payload in a custom type of your choosing

JsonElement getPayloadAsJsonElement()

Return the DirectMethodResponse payload in JsonElement type

String getPayloadAsJsonString()

Return the DirectMethodResponse payload in json string Use this if you wish to deserialize to a specific type using a deserialization library of your choice

Constructor Details

DirectMethodResponse

public DirectMethodResponse(Integer status, JsonElement payload)

Parameters:

status
payload

Method Details

getPayload

public T getPayload(Class clazz)

Return the DirectMethodResponse payload in a custom type of your choosing

Parameters:

clazz - the Custom type into which the payload can be deserialized

Returns:

the DirectMethodResponse payload in Custom type

getPayloadAsJsonElement

public JsonElement getPayloadAsJsonElement()

Return the DirectMethodResponse payload in JsonElement type

Returns:

the DirectMethodResponse payload in JsonElement type

getPayloadAsJsonString

public String getPayloadAsJsonString()

Return the DirectMethodResponse payload in json string Use this if you wish to deserialize to a specific type using a deserialization library of your choice

Returns:

the DirectMethodResponse payload in json string

Applies to