| Package | Description |
|---|---|
| net.dreamlu.mica.core.exception | |
| net.dreamlu.mica.core.result |
| Modifier and Type | Method and Description |
|---|---|
<T> R<T> |
ServiceException.getResult() |
| Constructor and Description |
|---|
ServiceException(R<?> result) |
| Modifier and Type | Method and Description |
|---|---|
static <T> R<T> |
R.fail(IResultCode rCode)
返回失败信息
|
static <T> R<T> |
R.fail(IResultCode rCode,
String msg)
返回失败信息
|
static <T> R<T> |
R.fail(String msg)
返回失败信息,用于 web
|
static <T> R<T> |
R.status(boolean status,
IResultCode sCode)
根据状态返回成功或者失败
|
static <T> R<T> |
R.status(boolean status,
String msg)
根据状态返回成功或者失败
|
static <T> R<T> |
R.success()
返回成功
|
static <T> R<T> |
R.success(T data)
成功-携带数据
|
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
R.getData(R<T> result)
获取data
|
static boolean |
R.isFail(R<?> result)
判断返回是否为成功
|
static boolean |
R.isSuccess(R<?> result)
判断返回是否为成功
|
static <T> void |
R.throwOn(Predicate<T> predicate,
T object,
R<?> result)
断言 成功时:直接抛出失败异常,返回传入的 result。
|
static void |
R.throwOnFail(R<?> result)
当 result 不成功时:直接抛出失败异常,返回传入的 result。
|
static void |
R.throwOnFail(R<?> result,
IResultCode rCode)
当 result 不成功时:直接抛出失败异常,返回传入的 rCode
|
static void |
R.throwOnFail(R<?> result,
IResultCode rCode,
String msg)
当 result 不成功时:直接抛出失败异常,返回传入的 rCode、message
|
Copyright © 2024. All rights reserved.