mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +08:00
bug fix
This commit is contained in:
parent
88a7fc7dc0
commit
046bfead03
@ -44,29 +44,4 @@ public class ValidateException extends StatefulException {
|
||||
public ValidateException(int status, String msg, Throwable throwable) {
|
||||
super(status, msg, throwable);
|
||||
}
|
||||
|
||||
/**
|
||||
* 满足条件就抛出异常
|
||||
*
|
||||
* @param condition 条件
|
||||
* @param msg 异常消息
|
||||
*/
|
||||
public static void matchThrow(boolean condition, String msg) {
|
||||
if (condition) {
|
||||
throw new ValidateException(msg);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 不满足条件就抛出异常
|
||||
*
|
||||
* @param condition 条件
|
||||
* @param msg 异常消息
|
||||
*/
|
||||
public static void nonMatchThrow(boolean condition, String msg) {
|
||||
if (false == condition) {
|
||||
throw new ValidateException(msg);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user