Skip to content

Latest commit

 

History

History
18 lines (12 loc) · 553 Bytes

README.md

File metadata and controls

18 lines (12 loc) · 553 Bytes

check Build Status

Checks preconditions (e.g. method parameter values) and generates nice error messages.

Example

  public int divide(int dividend, int divisor)
  {
    Check.parameter("divisor").withValue(divisor).isNotZero();
    return dividend/divisor;
  }

This first line of the method will throw an IllegalArgumentException if the parameter divisor is zero. The message will be:

Parameter divisor must not be zero