Package org.ros.internal.node.response
Class Response<T>
java.lang.Object
org.ros.internal.node.response.Response<T>
- Type Parameters:
T-
The response from an XML-RPC call.
- Author:
- damonkohler@google.com (Damon Kohler)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Response<T>fromListChecked(List<Object> response, ResultFactory<T> resultFactory) static <T> Response<T>fromListCheckedFailure(List<Object> response, ResultFactory<T> resultFactory) booleanstatic <T> Response<T>static <T> Response<T>newFailure(String message, T value) static <T> Response<T>newSuccess(String message, T value) toList()toString()
-
Constructor Details
-
Response
-
Response
-
-
Method Details
-
newError
-
newFailure
-
newSuccess
-
fromListCheckedFailure
public static <T> Response<T> fromListCheckedFailure(List<Object> response, ResultFactory<T> resultFactory) throws RemoteException Creates aResponsefrom theListofObjects returned from an XML-RPC call. ThrowsRemoteExceptionif theStatusCodeis StatusCode.FAILURE.- Type Parameters:
T-- Parameters:
response- theListofObjects returned from the XML-RPC callresultFactory- aResultFactorythat creates a result from the thirdObjectin theResponse- Returns:
- a
Responseusing the specifiedResultFactoryto generate the result - Throws:
RemoteException- if theResponse'sStatusCodeindicates StatusCode.FAILURE.
-
fromListChecked
public static <T> Response<T> fromListChecked(List<Object> response, ResultFactory<T> resultFactory) throws RemoteException Creates aResponsefrom theListofObjects returned from an XML-RPC call. ThrowsRemoteExceptionif theStatusCodeis not a success.- Type Parameters:
T-- Parameters:
response- theListofObjects returned from the XML-RPC callresultFactory- aResultFactorythat creates a result from the thirdObjectin theResponse- Returns:
- a
Responseusing the specifiedResultFactoryto generate the result - Throws:
RemoteException- if theResponse'sStatusCodedoes not indicate success
-
toList
-
getStatusCode
-
getStatusMessage
-
getResult
-
toString
-
isSuccess
public boolean isSuccess()
-