|
@@ -13,7 +13,7 @@ import java.lang.reflect.Array;
|
|
|
import java.util.Collection;
|
|
|
import java.util.Map;
|
|
|
|
|
|
-import static cn.com.qmth.examcloud.core.print.common.Constants.OE_CODE_400;
|
|
|
+import static cn.com.qmth.examcloud.core.print.common.Constants.PRT_CODE_400;
|
|
|
|
|
|
/**
|
|
|
* 参数校验类
|
|
@@ -25,43 +25,43 @@ public class Check {
|
|
|
|
|
|
public static void isNull(Object obj, String message) {
|
|
|
if (obj == null) {
|
|
|
- throw new StatusException(OE_CODE_400, message);
|
|
|
+ throw new StatusException(PRT_CODE_400, message);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public static void isEmpty(Object obj, String message) {
|
|
|
if (isEmpty(obj)) {
|
|
|
- throw new StatusException(OE_CODE_400, message);
|
|
|
+ throw new StatusException(PRT_CODE_400, message);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public static void isEmpty(Object[] array, String message) {
|
|
|
if (isEmpty(array)) {
|
|
|
- throw new StatusException(OE_CODE_400, message);
|
|
|
+ throw new StatusException(PRT_CODE_400, message);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public static void isEmpty(Collection<?> collection, String message) {
|
|
|
if (isEmpty(collection)) {
|
|
|
- throw new StatusException(OE_CODE_400, message);
|
|
|
+ throw new StatusException(PRT_CODE_400, message);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public static void isEmpty(Map<?, ?> map, String message) {
|
|
|
if (isEmpty(map)) {
|
|
|
- throw new StatusException(OE_CODE_400, message);
|
|
|
+ throw new StatusException(PRT_CODE_400, message);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public static void isBlank(CharSequence str, String message) {
|
|
|
if (isBlank(str)) {
|
|
|
- throw new StatusException(OE_CODE_400, message);
|
|
|
+ throw new StatusException(PRT_CODE_400, message);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public static void isFalse(Boolean expression, String message) {
|
|
|
if (expression == null || !expression) {
|
|
|
- throw new StatusException(OE_CODE_400, message);
|
|
|
+ throw new StatusException(PRT_CODE_400, message);
|
|
|
}
|
|
|
}
|
|
|
|