Class Validate
java.lang.Object
com.amilesend.client.util.Validate
Utility methods used to validate method input.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidThrows an exception if the given expression is false.static voidnotBlank(CharSequence chars, String message) Throws an exception if the givencharsis blank.static voidnotEmpty(Collection<?> collection, String message) Throws an exception if the givencollectionis empty.static voidThrows an exception if the givenmapis empty.static voidThrows an exception if the given object isnull.
-
Method Details
-
notBlank
Throws an exception if the givencharsis blank.- Parameters:
chars- the character sequence to validatemessage- the message to include in the exception thrown- Throws:
NullPointerException- if the char sequence is nullIllegalArgumentException- if the char sequence is not blank
-
notEmpty
Throws an exception if the givencollectionis empty.- Parameters:
collection- the collection to validatemessage- the message to include in the exception thrown- Throws:
NullPointerException- if the collection is nullIllegalArgumentException- if the collection is not blank
-
notEmpty
Throws an exception if the givenmapis empty.- Parameters:
map- the map to validatemessage- the message to include in the exception thrown- Throws:
NullPointerException- if the map is nullIllegalArgumentException- if the map is not blank
-
isTrue
Throws an exception if the given expression is false.- Parameters:
exp- the boolean expressionmessage- the message to include in the exception thrown- Throws:
IllegalArgumentException- if the expression is false
-
notNull
Throws an exception if the given object isnull.- Parameters:
obj- the objectmessage- the message to include in the exception thrown- Throws:
NullPointerException- if the object is null
-