Task #5877
closed
InvariantChecks: checkTrue and checkFalse methods
Added by Alexander Kamkin over 9 years ago.
Updated over 9 years ago.
Assignee:
Andrei Tatarnikov
Published in build:
150520
Description
- checkTrue(condition) throws IllegalArgumentException if the condition is false.
- checkFalse(condition) throws IllegalArgumentException if the condition is true.
/**
* Checks the invariant "Condition is true" and
* throws an exception if it is violated.
*
* @param condition Condition to be checked.
*
* @throws IllegalArgumentException if the invariant is violated
* ({@code condition} is {@code false}).
*/
public static void checkTrue(final boolean condition) {
if (!condition) {
throw new IllegalArgumentException();
}
}
- Status changed from New to Resolved
- % Done changed from 0 to 100
- Status changed from Resolved to Closed
- Published in build set to 150520
Also available in: Atom
PDF