See: Description
Package | Description |
---|---|
ch.trick17.betterchecks | |
ch.trick17.betterchecks.fluent |
Contains all fluent check classes, like
IntCheck ,
StringCheck and many more. |
ch.trick17.betterchecks.util |
Utility classes.
|
Check
.that(argument).check1().check2()...;
Examples:
Check
.that(greeting)
.matches("hello .*!")
.hasLengthBetween(0, 20)
;
Check
.that(list)
.isNullOr()
.hasSize(0)
;
Check
.that(names)
.named("list of names")
.isNotEmpty()
;
The check methods, such as matches(...)
or hasSize(...)
, 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
.
More documentation can be found in the Check
class, the primary
entry point to the library.
Copyright © 2012–2017 Michael Faes. All rights reserved.