public class ServiceResponse extends JsonWrapper
| Modifier and Type | Field and Description |
|---|---|
static String |
EMPTY_MESSAGE
The String representation of an empty service response in JSON.
|
EMPTY_JSON| Constructor and Description |
|---|
ServiceResponse()
Create a new, empty service response.
|
ServiceResponse(javax.json.JsonObject jsonObject,
boolean result)
Create a ServiceResponse based on the given JSON object.
|
ServiceResponse(javax.json.JsonObject jsonObject,
String serviceResponseType,
boolean result)
Create a ServiceResponse based on the given JSON object.
|
ServiceResponse(String jsonString,
boolean result)
Create a ServiceResponse based on the given String representation of a
JSON object.
|
ServiceResponse(String jsonString,
String serviceResponseType,
boolean result)
Create a ServiceResponse based on the given String representation of a
JSON object.
|
| Modifier and Type | Method and Description |
|---|---|
ServiceResponse |
clone()
Create a clone of this ServiceResponse.
|
boolean |
getResult()
Get the result flag of this response (i.e., if the service server
returned a success).
|
String |
getServiceResponseType()
Get the type of the service response if one was set.
|
void |
setServiceResponseType(String serviceResponseType)
Set the type of the service response.
|
equals, hashCode, toJsonObject, toStringpublic static final String EMPTY_MESSAGE
public ServiceResponse()
public ServiceResponse(String jsonString, boolean result)
jsonString - The JSON String to parse.result - The result flag for the response (i.e., if the service server
returned a success).public ServiceResponse(String jsonString, String serviceResponseType, boolean result)
jsonString - The JSON String to parse.serviceResponseType - The type of the service response (e.g., "std_srvs/Empty").result - The result flag for the response (i.e., if the service server
returned a success).public ServiceResponse(javax.json.JsonObject jsonObject,
boolean result)
jsonObject - The JSON object containing the service response data.result - The result flag for the response (i.e., if the service server
returned a success).public ServiceResponse(javax.json.JsonObject jsonObject,
String serviceResponseType,
boolean result)
jsonObject - The JSON object containing the service response data.serviceResponseType - The type of the service response (e.g., "std_srvs/Empty").result - The result flag for the response (i.e., if the service server
returned a success).public String getServiceResponseType()
public boolean getResult()
public void setServiceResponseType(String serviceResponseType)
serviceResponseType - The type of the service response (e.g., "std_srvs/Empty").public ServiceResponse clone()
clone in class JsonWrapperCopyright © 2014. All rights reserved.