Better Checks

The Better Checks library aims to provide a lightweight and concise, but powerful way for precondition checking, in particular for method arguments.

License

License

MIT License
GroupId

GroupId

ch.trick17.better-checks
ArtifactId

ArtifactId

better-checks
Last Version

Last Version

1.1
Release Date

Release Date

Type

Type

pom
Description

Description

Better Checks
The Better Checks library aims to provide a lightweight and concise, but powerful way for precondition checking, in particular for method arguments.
Project URL

Project URL

http://better-checks.trick17.ch
Project Organization

Project Organization

Michael Faes
Source Code Management

Source Code Management

https://github.com/rolve/better-checks

Download better-checks

Filename Size
better-checks-1.1.pom 7 KB
Browse

How to add to project

<!-- https://jarcasting.com/artifacts/ch.trick17.better-checks/better-checks/ -->
<dependency>
    <groupId>ch.trick17.better-checks</groupId>
    <artifactId>better-checks</artifactId>
    <version>1.1</version>
    <type>pom</type>
</dependency>
// https://jarcasting.com/artifacts/ch.trick17.better-checks/better-checks/
implementation 'ch.trick17.better-checks:better-checks:1.1'
// https://jarcasting.com/artifacts/ch.trick17.better-checks/better-checks/
implementation ("ch.trick17.better-checks:better-checks:1.1")
'ch.trick17.better-checks:better-checks:pom:1.1'
<dependency org="ch.trick17.better-checks" name="better-checks" rev="1.1">
  <artifact name="better-checks" type="pom" />
</dependency>
@Grapes(
@Grab(group='ch.trick17.better-checks', module='better-checks', version='1.1')
)
libraryDependencies += "ch.trick17.better-checks" % "better-checks" % "1.1"
[ch.trick17.better-checks/better-checks "1.1"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

  • core
  • core-gwt

Better Checks build status

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:

http://better-checks.trick17.ch

Versions

Version
1.1
1.0