R - type of the resultpublic class CommandResponse<R> extends Object
| Modifier and Type | Method and Description |
|---|---|
Throwable |
getException() |
R |
getResult() |
boolean |
isSuccess() |
static <T> CommandResponse<T> |
ofFailure(Throwable ex)
Construct a failed response with given exception.
|
static <T> CommandResponse<T> |
ofFailure(Throwable ex,
T result)
Construct a failed response with given exception.
|
static <T> CommandResponse<T> |
ofSuccess(T result)
Construct a successful response with given object.
|
public static <T> CommandResponse<T> ofSuccess(T result)
T - type of the resultresult - result objectpublic static <T> CommandResponse<T> ofFailure(Throwable ex)
ex - cause of the failurepublic static <T> CommandResponse<T> ofFailure(Throwable ex, T result)
ex - cause of the failureresult - additional message of the failurepublic boolean isSuccess()
public R getResult()
public Throwable getException()
Copyright © 2020 Alibaba Group. All rights reserved.