Skip to content

Simple framework to check preconditions (e.g. method parameters) and produces nice error messages

License

Notifications You must be signed in to change notification settings

weissreto/check

Repository files navigation

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

About

Simple framework to check preconditions (e.g. method parameters) and produces nice error messages

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages