https://github.com/rolve/better-checks
Better Checks
https://github.com/rolve/better-checks
argument-checks fluent-interface java precondition-checks
Last synced: about 1 month ago
JSON representation
Better Checks
- Host: GitHub
- URL: https://github.com/rolve/better-checks
- Owner: rolve
- License: mit
- Created: 2012-09-20T09:48:47.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2017-06-06T20:06:30.000Z (over 8 years ago)
- Last Synced: 2025-08-25T13:56:42.806Z (6 months ago)
- Topics: argument-checks, fluent-interface, java, precondition-checks
- Language: Java
- Homepage: http://better-checks.trick17.ch
- Size: 289 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Better Checks [](https://travis-ci.org/rolve/better-checks)
The **Better Checks** library provides a lightweight and concise, but powerful way for precodition checking in Java, in particular for method arguments. Checks are written in a fluent way.
Examples:
Check.that(name).matches("hello .*!").hasLengthBetween(0, 20);
Check.that(list).isNullOr().hasSize(0);
Check.that(args).named("arguments").isNotEmpty();
The actual checking methods, such as `matches(...)` or `hasSize(...)`, all throw an exception if the check fails. The exact type of exception depends on the kind of check that is called but in most cases it is `IllegalArgumentException`.
## Project Website
For more information, visit the project's website: