Package com.imyeyu.java.bean.timi
Class TimiException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.imyeyu.java.bean.timi.TimiException
- All Implemented Interfaces:
Serializable
通用运行时异常,附加通用代码和消息代码
- Since:
- 2021-05-20 15:18
- Author:
- 夜雨
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTimiException(TimiCode code) TimiException(TimiCode code, String messageCode) 构造器TimiException(TimiCode code, String messageCode, Throwable e) 构造器构造器 -
Method Summary
Modifier and TypeMethodDescriptiongetCode()代码消息插值参数消息代码static <T> Tstatic <T> Tstatic <T> voidrequiredNull(T t, String messageCode) static <T> voidrequiredNull(T t, String messageCode, Map<String, Object> messageArgs) static voidrequiredTrue(boolean bool, String messageCode) static voidrequiredTrue(boolean bool, String messageCode, Map<String, Object> messageArgs) static voidrequiredTrue(CallbackReturn<Boolean> callback, String messageCode) static voidrequiredTrue(CallbackReturn<Boolean> callback, String messageCode, Map<String, Object> messageArgs) TimiResponse<?> 转为通用响应Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
code
代码 -
messageCode
消息代码 -
messageArgs
消息插值参数
-
-
Constructor Details
-
TimiException
- Parameters:
code- 代码
-
TimiException
构造器- Parameters:
code- 代码messageCode- 消息代码
-
TimiException
构造器- Parameters:
code- 代码messageCode- 消息代码messageArgs- 消息插值参数
-
TimiException
构造器- Parameters:
code- 代码messageCode- 消息代码e- 异常
-
-
Method Details
-
toResponse
转为通用响应- Returns:
- 响应
-
required
-
required
-
requiredNull
- Throws:
TimiException
-
requiredNull
public static <T> void requiredNull(T t, String messageCode, Map<String, Object> messageArgs) throws TimiException- Throws:
TimiException
-
requiredTrue
- Throws:
TimiException
-
requiredTrue
public static void requiredTrue(boolean bool, String messageCode, Map<String, Object> messageArgs) throws TimiException- Throws:
TimiException
-
requiredTrue
public static void requiredTrue(CallbackReturn<Boolean> callback, String messageCode) throws TimiException - Throws:
TimiException
-
requiredTrue
public static void requiredTrue(CallbackReturn<Boolean> callback, String messageCode, Map<String, Object> messageArgs) throws TimiException- Throws:
TimiException
-
getCode
代码 -
getMessageCode
消息代码 -
getMessageArgs
消息插值参数
-