public class JsonResponse<R> extends Object implements Serializable
| 构造器和说明 |
|---|
JsonResponse() |
| 限定符和类型 | 方法和说明 |
|---|---|
JsonResponse<R> |
addOtherData(String key,
Object value)
Add other data value
|
static <R> JsonResponse<R> |
build()
Build a json response
|
static <R> JsonResponse<R> |
failure(String message)
Build a failure json response with message
|
static <R> JsonResponse<R> |
message(boolean status,
String message)
Build a message json response with status and message
|
JsonResponse<R> |
removeOtherData(String key)
Remove other data value
|
static <R> JsonResponse<R> |
success(R data)
Build a success json response with data
|
static <R> JsonResponse<R> |
successMessage(String message)
Build a success json response with message
|
public static <R> JsonResponse<R> build()
public static <R> JsonResponse<R> success(R data)
data - the success response datapublic static <R> JsonResponse<R> successMessage(String message)
message - the success response messagepublic static <R> JsonResponse<R> message(boolean status, String message)
status - the response statusmessage - the response messagepublic static <R> JsonResponse<R> failure(String message)
message - the failure response messagepublic JsonResponse<R> addOtherData(String key, Object value)
key - key of other datavalue - value of other datapublic JsonResponse<R> removeOtherData(String key)
key - key of other dataCopyright © 2019. All rights reserved.