Package org.apache.juneau.assertions
Class Verify
java.lang.Object
org.apache.juneau.assertions.Verify
Utility class for performing simple validations on objects.
Verifications that pass return a null string. Verifications that don't pass return a string with a useful error message.
Example:
See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionVerifies that this object is equal to the specified object.isFalse()
Verifies that this object is equal toBoolean.FALSE
.isTrue()
Verifies that this object is equal toBoolean.TRUE
.Verifies that this object is of the specified type.Overrides the default error message produced by the verification.static Verify
Create a new verifier object.
-
Constructor Details
-
Verify
Create a new verifier object.- Parameters:
o
- The object being verified.
-
-
Method Details
-
verify
Create a new verifier object.- Parameters:
o
- The object being verified.- Returns:
- A new verifier object.
-
msg
Overrides the default error message produced by the verification.- Parameters:
msg
- The error message.args
- Optional message arguments.- Returns:
- This object.
-
isType
Verifies that this object is of the specified type.- Parameters:
type
- The type to test against.- Returns:
- An error message if the object is not of the specified type, otherwise
null .
-
is
Verifies that this object is equal to the specified object.- Parameters:
expected
- The object to test against for equality.- Returns:
- An error message if the object is not equal to the specified object, otherwise
null .
-
isTrue
Verifies that this object is equal toBoolean.TRUE
.- Returns:
- An error message if the object is not true, otherwise
null .
-
isFalse
Verifies that this object is equal toBoolean.FALSE
.- Returns:
- An error message if the object is not false, otherwise
null .
-