A tool to automatically check Groovy class method parameters to make sure they aren't null or empty.
You would use this if you:
- Like your code to fail fast
- Don't like writing boilerplate code
- Don't like writing extra unit tests
- Need a solution that supports Groovy
- Prefer as solution that requires zero configuration to use
- Include this project in your code via sources, Gradle, Maven, etc.
- Annotate your Groovy classes with @ParamsNotNullNotEmpty.
- At compile time, code will be added into each of your methods to check each parameter to make sure it is not null and in the case of Collections, Maps and Strings, it is not empty.
- At run time, if a parameter is null or empty, it will throw an IllegalArgumentException with details about the null or empty parameter.
- To disable the annotation at compile time, set the ParamsNotNullNotEmpty.NoOpMode property to true.
See the integration tests
Include in your Ant/Gradle/Grails/Maven project using binaries from Maven central
com.faceture groovy-params-checker 1.0.27This project was informed and inspired by other great work: