类 Assert
java.lang.Object
com.dinstone.vertx.web.util.Assert
public final class Assert extends Object
-
方法概要
修饰符和类型 方法 说明 static voidalways(String message)Will always throw and IlligalArgumentExceptionstatic voidisFalse(boolean test, String message)Tests if condition is falsestatic <T> voidisNull(T test, String message)Tests if object is nullstatic <T> voidisNullOrEmpty(List<T> list, String message)Tests if list is null or emptystatic <T, K> voidisNullOrEmpty(Map<T,K> map, String message)Tests if map is null or emptystatic <T> voidisNullOrEmpty(Set<T> set, String message)Tests if set is null or emptystatic <T> voidisNullOrEmpty(T[] array, String message)Tests if array is null or emptystatic voidisTrue(boolean test, String message)Tests if condition is truestatic <T> voidnotNull(T test, String message)Tests if object is !static <T> voidnotNullOrEmpty(Collection<T> list, String message)Tests if list is null or emptystatic <T, K> voidnotNullOrEmpty(Map<T,K> map, String message)Tests if map is null or emptystatic <T> voidnotNullOrEmpty(Set<T> set, String message)Tests if list is null or emptystatic <T> voidnotNullOrEmpty(T[] array, String message)Tests if list is null or emptystatic voidnotNullOrEmptyTrimmed(String value, String message)Tests if String is null or empty when trimmed
-
方法详细资料
-
always
Will always throw and IlligalArgumentException- 参数:
message- fail message aka: "forgot to implement this"
-
isFalse
Tests if condition is false- 参数:
test- must be falsemessage- to return in exception- 抛出:
IllegalArgumentException- if test is true
-
isTrue
Tests if condition is true- 参数:
test- must be turemessage- to return in exception- 抛出:
IllegalArgumentException- if test is false
-
isNull
Tests if object is null- 类型参数:
T- object type- 参数:
test- must be nullmessage- to return in exception- 抛出:
IllegalArgumentException- if object != null
-
notNull
Tests if object is != null- 类型参数:
T- object type- 参数:
test- must not be nullmessage- to return in exception- 抛出:
IllegalArgumentException- if object == null
-
notNullOrEmptyTrimmed
Tests if String is null or empty when trimmed- 参数:
value- must be non empty stringmessage- to return in exception- 抛出:
IllegalArgumentException- if value == null, value == "" or value.trim() == ""
-
notNullOrEmpty
Tests if list is null or empty- 类型参数:
T- object type- 参数:
list- must be have at least one elementmessage- to return in exception- 抛出:
IllegalArgumentException- if list == null or list.size() == 0
-
notNullOrEmpty
Tests if list is null or empty- 类型参数:
T- object type- 参数:
set- must be have at least one elementmessage- to return in exception- 抛出:
IllegalArgumentException- if list == null or list.size() == 0
-
notNullOrEmpty
Tests if list is null or empty- 类型参数:
T- object type- 参数:
array- must be have at least one elementmessage- to return in exception- 抛出:
IllegalArgumentException- if list == null or list.size() == 0
-
notNullOrEmpty
Tests if map is null or empty- 类型参数:
T- object typeK- value type- 参数:
map- must be have at least one elementmessage- to return in exception- 抛出:
IllegalArgumentException- if list == null or list.size() == 0
-
isNullOrEmpty
Tests if list is null or empty- 类型参数:
T- object type- 参数:
list- must be null or emptymessage- to return in exception- 抛出:
IllegalArgumentException- if list != null or list.size() greater than 0
-
isNullOrEmpty
Tests if set is null or empty- 类型参数:
T- object type- 参数:
set- must be null or emptymessage- to return in exception- 抛出:
IllegalArgumentException- if list != null or list.size() greater than 0
-
isNullOrEmpty
Tests if array is null or empty- 类型参数:
T- object type- 参数:
array- must be null or emptymessage- to return in exception- 抛出:
IllegalArgumentException- if list != null or list.size() greater than 0
-
isNullOrEmpty
Tests if map is null or empty- 类型参数:
T- object typeK- value type- 参数:
map- must be null or emptymessage- to return in exception- 抛出:
IllegalArgumentException- if list != null or list.size() greater than 0
-