A good example about why Java Argument Validation was created can be red from Elliotte Rusty Harold web log Why Methods Should Check Their Arguments.

There is also an article Java best practices Validate method and constructor arguments, which exactly explains why checking arguments of public methods and constructors is important.

The idea for Java Argument Validation came from a project on which arguments where not checked. The test department run some tests and several times they came with issues, that something wasn't working, Which then after some investigation wasn't the case, because they had provided incorrect or to few parameters. Or the provided values where incorrect. Yes, you're right, the test specifications should have been better. Correct! But the same was true for the 'use cases', 'User stories' or 'functional specification'. This solution made that application more robust and far more clear for the testers. As it provide fast and good feedback about what was wrong, with the parameters they used.

There are several small validation packages out there, but they all seam to concentrate around, web application user input validation. Several other are about checking command line arguments. Therefore I continued to work on the project specific solution. After a while I realized that the class ArgumentValidation got quite some nice features, which made me decide to extract it from the main project. Cleanup it up adding some missing parts of the java documentation and publish it on

Read the Getting Started page to get a good idea what this api can do and how it is used.

Wiki Pedia related articles

Similar projects