public class R<T> extends Object
| 限定符和类型 | 类和说明 |
|---|---|
static class |
R.Status
Represents server and client side status code
|
| 构造器和说明 |
|---|
R() |
| 限定符和类型 | 方法和说明 |
|---|---|
static <T> R<T> |
failed(ErrorCode errorCode,
String msg)
Wraps an error code and error message for failure.
|
static <T> R<T> |
failed(Exception exception)
Wraps an exception for failure.
|
static <T> R<T> |
failed(R.Status statusCode,
String msg)
Wraps a status code and error message for failure.
|
T |
getData() |
Exception |
getException() |
String |
getMessage() |
Integer |
getStatus() |
void |
setData(T data) |
void |
setException(Exception exception) |
void |
setStatus(Integer status) |
static <T> R<T> |
success()
Returns a succeed status.
|
static <T> R<T> |
success(T data)
Wraps a succeed rpc response object.
|
String |
toString()
Constructs a
String by R instance. |
public Exception getException()
public void setException(Exception exception)
public String getMessage()
public Integer getStatus()
public void setStatus(Integer status)
public T getData()
public void setData(T data)
public static <T> R<T> failed(Exception exception)
exception - exception objectRpublic static <T> R<T> failed(ErrorCode errorCode, String msg)
errorCode - rpc error codemsg - error messageRpublic static <T> R<T> failed(R.Status statusCode, String msg)
statusCode - status codemsg - error messageRpublic static <T> R<T> success()
Rpublic static <T> R<T> success(T data)
data - rpc response objectRCopyright © 2023. All rights reserved.