public interface AssertBehavior
| 限定符和类型 | 方法和说明 |
|---|---|
default AssertBehavior |
foundClass(String fullClassName,
String errorMessage)
断言class文件存在
|
default AssertBehavior |
foundClass(String fullClassName,
String template,
Object... args)
断言class文件存在
|
void |
newException(String errorMessage)
抛出新的异常
|
void |
newException(String template,
Object... args)
抛出新的异常
|
default AssertBehavior |
notEmpty(Object obj,
String template,
Object... args)
不为空
空参数的定义如下
1、对象不为null 2、String 不为"" or " " 3、List,Set,Map,Object[],int[],long[] 长度大于0 |
default AssertBehavior |
notNull(Object obj,
String exceptionMessage)
如果为true 则抛出异常
|
default AssertBehavior |
notNull(Object obj,
String template,
Object... args)
不为null
|
default AssertBehavior |
notTrue(boolean boo,
String exceptionMessage)
如果为true 则抛出异常
|
default AssertBehavior |
notTrue(boolean boo,
String template,
Object... args)
如果为true 则抛出异常
|
void newException(String errorMessage)
errorMessage - 异常消息void newException(String template, Object... args)
template - 异常消息模板args - 模板替换参数default AssertBehavior notTrue(boolean boo, String exceptionMessage)
boo - 判断exceptionMessage - 异常信息default AssertBehavior notTrue(boolean boo, String template, Object... args)
boo - 判断template - 异常消息模板args - 模板替换参数default AssertBehavior notNull(Object obj, String exceptionMessage)
obj - 判断对象exceptionMessage - 异常信息default AssertBehavior notNull(Object obj, String template, Object... args)
obj - 判断对象template - 异常消息模板args - 模板替换参数default AssertBehavior notEmpty(Object obj, String template, Object... args)
空参数的定义如下
1、对象不为null
2、String 不为"" or " "
3、List,Set,Map,Object[],int[],long[] 长度大于0
obj - 判断对象template - 异常消息模板args - 模板替换参数default AssertBehavior foundClass(String fullClassName, String errorMessage)
fullClassName - class对象全类名errorMessage - 异常消息default AssertBehavior foundClass(String fullClassName, String template, Object... args)
fullClassName - class对象全类名template - 异常消息模板args - 模板替换参数Copyright © 2019. All rights reserved.