https://github.com/gab-studios/gab-validate
A GABStudios Java library to help with data validation.
https://github.com/gab-studios/gab-validate
gab-studios gab-validate java11 java8 validation validation-library validation-util
Last synced: 3 months ago
JSON representation
A GABStudios Java library to help with data validation.
- Host: GitHub
- URL: https://github.com/gab-studios/gab-validate
- Owner: gab-studios
- License: apache-2.0
- Created: 2014-10-11T21:36:43.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2022-12-04T22:11:02.000Z (over 2 years ago)
- Last Synced: 2025-02-03T22:40:53.986Z (4 months ago)
- Topics: gab-studios, gab-validate, java11, java8, validation, validation-library, validation-util
- Language: Java
- Homepage:
- Size: 248 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
[](https://sonarcloud.io/dashboard?id=gab-studios_gab-validate)
[](https://api.securityscorecards.dev/projects/github.com/gab-studios/gab-validate)
GAB-Validate
=======The GAB Studios Validation Library for Java. The purpose of this project is to analyze and examine how I would create a validation library for Java. Comments are welcome. Thank you.
Maven Dependency
---------
Release
```javacom.gabstudios
gab-validate
1.0.0```
Development
```javacom.gabstudios
gab-validate
2.0.0-SNAPSHOT```
Build
---------
Use Maven to build - `mvn package`.Required
---------
This project requires the following:* Java 8, 11
* MavenUsage
---------In order to validate, you need to call a defineXXXXXX() method `Validate.defineString("HelloWorld")`. Once that is done, you can perform tests by chain calling test methods.
```java
Validate.defineString("HelloWorld").testMaxLength(10).throwValidationExceptionOnFail().validate();boolean retVal = Validate.defineInteger(5000).testMaxValue(max).testMinValue(min).validate();
```
Example
---------To validate a Boolean:
```java
Validate.defineBoolean(name != null && name.length() > 0)
.testTrue()
.throwValidationExceptionOnFail()
.validate();
``````java
boolean retVal = Validate.defineBoolean(name != null && name.length() > 0)
.testTrue()
.validate();
```To validate a String:
```java
Validate.defineString("HelloWorld").testEqualsNoCase("hELLOwORLD")
.testMaxLength(10)
.throwValidationExceptionOnFail()
.validate();
``````java
boolean retVal = Validate.defineString("HelloWorld")
.testMaxLength(10)
.testEqualsNoCase("hELLOwORLD")
.validate();
```More Documentation
------------------
Check the project [wiki].Copyright
-------
[Copyright 2015 Gregory Brown]License
-------
This codebase is licensed under the [Apache v2.0 License].Feedback
---------
Comments and feedback are greatly appreciated!!![Copyright 2015 Gregory Brown]: https://github.com/gab-studios/gab-validate/tree/master/COPYRIGHT.txt
[Apache v2.0 License]: https://github.com/gab-studios/gab-validate/tree/master/LICENSE.txt
[wiki]: https://github.com/gab-studios/gab-validate/wiki
[examples]: https://github.com/gab-studios/gab-validate/wiki/Examples