public class Validation extends Object
| 构造器和说明 |
|---|
Validation() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
assertEquals(Object excepted,
Object source)
断言:必须相等
|
static void |
assertEquals(Object excepted,
Object source,
BaseErrorCode errorCode)
断言:必须相等
|
static void |
assertEquals(Object excepted,
Object source,
BaseErrorCode errorCode,
String msg)
断言:必须相等
|
static void |
assertEquals(Object excepted,
Object source,
String msg)
断言:必须相等
|
static void |
assertNotEmpty(CharSequence str,
BaseErrorCode errorCode,
String msg)
断言:字符串不为空
|
static void |
assertNotEmpty(Collection collection,
BaseErrorCode errorCode,
String msg)
断言:集合不为空
|
static void |
assertNotEmpty(Collection collection,
String msg)
断言:集合不为空
|
static void |
assertNotEmpty(Map map,
BaseErrorCode errorCode,
String msg)
断言:Map不为空
|
static void |
assertNotEmpty(Map map,
String msg)
断言:Map不为空
|
static void |
assertNotEmpty(String str,
String msg)
断言:字符串不为空
|
static void |
assertNotNull(Object object,
BaseErrorCode errorCode,
String msg)
断言:引用不为NULL
|
static void |
assertNotNull(Object object,
String msg)
断言:引用不为NULL
|
static void |
assertTrue(boolean condition)
断言:必须为真
|
static void |
assertTrue(boolean condition,
BaseErrorCode exceptionCode)
断言:必须为真
|
static void |
assertTrue(boolean condition,
BaseErrorCode errorCode,
String msg)
断言:必须为真
|
static void |
assertTrue(boolean condition,
String msg)
断言:必须为真
|
static void |
paramMust(Boolean condition,
String msg)
验证:参数必须满足某个条件
|
static void |
paramNotEmpty(CharSequence str,
String msg)
验证:参数不为空
|
static void |
paramNotEmpty(Collection collection,
String msg)
验证:参数不为空
|
static void |
paramNotEmpty(Map map,
String msg)
验证:参数不为空
|
static void |
paramNotNull(Object obj,
String msg)
验证:参数不为NULL
|
static void |
rejectIf(Boolean condition,
BaseErrorCode exceptionCode)
条件为真时拒绝
|
static void |
rejectIf(Boolean condition,
BaseErrorCode exceptionCode,
String msg)
条件为真时拒绝
|
static void |
rejectIf(Boolean condition,
String msg)
条件为真时拒绝
|
public static void assertNotNull(Object object, BaseErrorCode errorCode, String msg)
object - errorCode - msg - public static void assertNotNull(Object object, String msg)
object - msg - public static void assertNotEmpty(Collection collection, BaseErrorCode errorCode, String msg)
collection - 集合errorCode - msg - public static void assertNotEmpty(Collection collection, String msg)
collection - 集合msg - public static void assertNotEmpty(CharSequence str, BaseErrorCode errorCode, String msg)
str - 字符串errorCode - msg - public static void assertNotEmpty(String str, String msg)
str - 字符串msg - public static void assertNotEmpty(Map map, BaseErrorCode errorCode, String msg)
map - MaperrorCode - msg - public static void assertTrue(boolean condition,
BaseErrorCode errorCode,
String msg)
condition - errorCode - msg - public static void assertTrue(boolean condition,
String msg)
condition - msg - public static void assertTrue(boolean condition,
BaseErrorCode exceptionCode)
condition - exceptionCode - public static void assertTrue(boolean condition)
condition - 条件public static void assertEquals(Object excepted, Object source)
excepted - 期望值source - 实际值public static void assertEquals(Object excepted, Object source, BaseErrorCode errorCode)
excepted - 期望值source - 实际值errorCode - public static void assertEquals(Object excepted, Object source, String msg)
excepted - 期望值source - 实际值msg - public static void assertEquals(Object excepted, Object source, BaseErrorCode errorCode, String msg)
excepted - 期望值source - 实际值errorCode - msg - public static void rejectIf(Boolean condition, BaseErrorCode exceptionCode, String msg)
condition - 条件exceptionCode - msg - public static void rejectIf(Boolean condition, BaseErrorCode exceptionCode)
condition - 条件exceptionCode - public static void paramNotEmpty(Collection collection, String msg)
collection - 集合msg - public static void paramNotEmpty(CharSequence str, String msg)
str - 字符串msg - Copyright © 2018. All rights reserved.