public class Assertion<T extends Throwable> extends Object implements Serializable
Example:
Assertion<TheExceptionType> assertion = new Assertion<ParamException> ();
assertion.validate (param != null, new TheExceptionType("invalid parameter null"));
or, in a more compact form:
// The exception to throw in case of failure
// during the evaluation of the expected condition
new Assertion<TheExceptionType>().validate(
i>5, // The expected boolean condition
new TheExceptionType("Parameter must be greater than 5")); //The error message
Copyright © 2018. All Rights Reserved.