T
- public class RestResponse<T> extends Object
构造器和说明 |
---|
RestResponse() |
RestResponse(boolean success) |
RestResponse(boolean success,
String msg) |
RestResponse(boolean success,
String msg,
int code) |
RestResponse(boolean success,
T payload) |
RestResponse(boolean success,
T payload,
int code) |
限定符和类型 | 方法和说明 |
---|---|
static RestResponse |
fail() |
static RestResponse |
fail(int code) |
static RestResponse |
fail(int code,
String msg) |
static RestResponse |
fail(String msg) |
int |
getCode() |
String |
getMsg() |
T |
getPayload() |
long |
getTimestamp() |
boolean |
isSuccess() |
static RestResponse |
ok() |
static <T> RestResponse |
ok(int code) |
static <T> RestResponse |
ok(T payload) |
static <T> RestResponse |
ok(T payload,
int code) |
void |
setCode(int code) |
void |
setMsg(String msg) |
void |
setPayload(T payload) |
void |
setSuccess(boolean success) |
void |
setTimestamp(long timestamp) |
public RestResponse()
public RestResponse(boolean success)
public RestResponse(boolean success, T payload)
public RestResponse(boolean success, T payload, int code)
public RestResponse(boolean success, String msg)
public RestResponse(boolean success, String msg, int code)
public T getPayload()
public void setPayload(T payload)
public boolean isSuccess()
public void setSuccess(boolean success)
public String getMsg()
public void setMsg(String msg)
public int getCode()
public void setCode(int code)
public long getTimestamp()
public void setTimestamp(long timestamp)
public static RestResponse ok()
public static <T> RestResponse ok(T payload)
public static <T> RestResponse ok(int code)
public static <T> RestResponse ok(T payload, int code)
public static RestResponse fail()
public static RestResponse fail(String msg)
public static RestResponse fail(int code)
public static RestResponse fail(int code, String msg)
Copyright © 2017. All rights reserved.