Project

General

Profile

Task #5877

InvariantChecks: checkTrue and checkFalse methods

Added by Alexander Kamkin almost 5 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Andrei Tatarnikov
Category:
Utilities
Target version:
Start date:
04/22/2015
Due date:
% Done:

100%

Estimated time:
Detected in build:
svn
Published in build:
150520

Description

  1. checkTrue(condition) throws IllegalArgumentException if the condition is false.
  2. checkFalse(condition) throws IllegalArgumentException if the condition is true.

History

#1

Updated by Alexander Kamkin almost 5 years ago

  /**
   * 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();
    }
  }
#2

Updated by Andrei Tatarnikov over 4 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

Done in r970.

#3

Updated by Andrei Tatarnikov over 4 years ago

  • Status changed from Resolved to Closed
  • Published in build set to 150520

Also available in: Atom PDF