| Package | Description |
|---|---|
| net.dreamlu.mica.core.exception | |
| net.dreamlu.mica.core.result |
| Constructor and Description |
|---|
ServiceException(IResultCode rCode) |
ServiceException(IResultCode rCode,
String message) |
| Modifier and Type | Class and Description |
|---|---|
class |
SystemCode
系统内置code
|
| 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.status(boolean status,
IResultCode sCode)
根据状态返回成功或者失败
|
static void |
R.throwFail(IResultCode rCode)
直接抛出失败异常,抛出 code 码
|
static void |
R.throwFail(IResultCode rCode,
String message)
直接抛出失败异常,抛出 code 码
|
static <T> void |
R.throwOn(Predicate<T> predicate,
T object,
IResultCode rCode)
断言 成功时:直接抛出失败异常,返回传入的 result。
|
static <T> void |
R.throwOn(Predicate<T> predicate,
T object,
IResultCode rCode,
String msg)
断言 成功时:直接抛出失败异常,返回传入的 result。
|
static void |
R.throwOnFail(R<?> result,
IResultCode rCode)
当 result 不成功时:直接抛出失败异常,返回传入的 rCode
|
static void |
R.throwOnFail(R<?> result,
IResultCode rCode,
String msg)
当 result 不成功时:直接抛出失败异常,返回传入的 rCode、message
|
static void |
R.throwOnFalse(boolean status,
IResultCode rCode)
当 status 不为 true 时:直接抛出失败异常 rCode
|
static void |
R.throwOnFalse(boolean status,
IResultCode rCode,
String msg)
当 status 不为 true 时:直接抛出失败异常 rCode、message
|
Copyright © 2024. All rights reserved.