T
- public class Response<T>
extends java.lang.Object
Constructor and Description |
---|
Response(int statusCode,
java.lang.String statusMessage,
T value) |
Response(StatusCode statusCode,
java.lang.String statusMessage,
T value) |
Modifier and Type | Method and Description |
---|---|
static <T> Response<T> |
fromListChecked(java.util.List<java.lang.Object> response,
ResultFactory<T> resultFactory)
|
static <T> Response<T> |
fromListCheckedFailure(java.util.List<java.lang.Object> response,
ResultFactory<T> resultFactory)
|
T |
getResult() |
StatusCode |
getStatusCode() |
java.lang.String |
getStatusMessage() |
boolean |
isSuccess() |
static <T> Response<T> |
newError(java.lang.String message,
T value) |
static <T> Response<T> |
newFailure(java.lang.String message,
T value) |
static <T> Response<T> |
newSuccess(java.lang.String message,
T value) |
java.util.List<java.lang.Object> |
toList() |
java.lang.String |
toString() |
public Response(int statusCode, java.lang.String statusMessage, T value)
public Response(StatusCode statusCode, java.lang.String statusMessage, T value)
public static <T> Response<T> newError(java.lang.String message, T value)
public static <T> Response<T> newFailure(java.lang.String message, T value)
public static <T> Response<T> newSuccess(java.lang.String message, T value)
public static <T> Response<T> fromListCheckedFailure(java.util.List<java.lang.Object> response, ResultFactory<T> resultFactory) throws RemoteException
Response
from the List
of Object
s
returned from an XML-RPC call. Throws RemoteException
if the
StatusCode
is StatusCode.FAILURE.T
- response
- the List
of Object
s returned from the XML-RPC callresultFactory
- a ResultFactory
that creates a result from the third
Object
in the Response
Response
using the specified ResultFactory
to
generate the resultRemoteException
- if the Response
's StatusCode
indicates
StatusCode.FAILURE.public static <T> Response<T> fromListChecked(java.util.List<java.lang.Object> response, ResultFactory<T> resultFactory) throws RemoteException
Response
from the List
of Object
s
returned from an XML-RPC call. Throws RemoteException
if the
StatusCode
is not a success.T
- response
- the List
of Object
s returned from the XML-RPC callresultFactory
- a ResultFactory
that creates a result from the third
Object
in the Response
Response
using the specified ResultFactory
to
generate the resultRemoteException
- if the Response
's StatusCode
does not indicate
successpublic java.util.List<java.lang.Object> toList()
public StatusCode getStatusCode()
public java.lang.String getStatusMessage()
public T getResult()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean isSuccess()