{"id":42847103,"url":"https://github.com/mvallim/java-fluent-validator","last_synced_at":"2026-01-30T11:58:48.393Z","repository":{"id":35936692,"uuid":"201566896","full_name":"mvallim/java-fluent-validator","owner":"mvallim","description":"Java Fluent Validator is inspired by Fluent Interface and .Net FluentValidation which defined an inner-DSL within Java language for programmers to use. A fluent interface implies that its primary goal is to make it easy to SPEAK and UNDERSTAND. ","archived":false,"fork":false,"pushed_at":"2023-09-18T01:31:52.000Z","size":961,"stargazers_count":168,"open_issues_count":9,"forks_count":19,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-08-03T16:49:24.761Z","etag":null,"topics":["builder","fluent","fluent-api","fluent-interface","java","java-fluent-validator","kotlin","spring","spring-support","validation","validation-engine","validation-library","validation-rules","validator"],"latest_commit_sha":null,"homepage":"https://mvallim.github.io/java-fluent-validator/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mvallim.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-10T02:12:08.000Z","updated_at":"2025-06-27T18:03:01.000Z","dependencies_parsed_at":"2022-07-20T15:32:16.059Z","dependency_job_id":null,"html_url":"https://github.com/mvallim/java-fluent-validator","commit_stats":null,"previous_names":[],"tags_count":36,"template":false,"template_full_name":null,"purl":"pkg:github/mvallim/java-fluent-validator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvallim%2Fjava-fluent-validator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvallim%2Fjava-fluent-validator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvallim%2Fjava-fluent-validator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvallim%2Fjava-fluent-validator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mvallim","download_url":"https://codeload.github.com/mvallim/java-fluent-validator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvallim%2Fjava-fluent-validator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28912184,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T11:55:24.701Z","status":"ssl_error","status_checked_at":"2026-01-30T11:54:13.194Z","response_time":66,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["builder","fluent","fluent-api","fluent-interface","java","java-fluent-validator","kotlin","spring","spring-support","validation","validation-engine","validation-library","validation-rules","validator"],"created_at":"2026-01-30T11:58:48.100Z","updated_at":"2026-01-30T11:58:48.379Z","avatar_url":"https://github.com/mvallim.png","language":"Java","readme":"\u003cp align=\"center\"\u003e\u003cimg src=\"documentation/fluent.png\" height=\"20%\" width=\"20%\"\u003e\u003c/p\u003e\n\n# Java Fluent Validator\n\n![Java CI with Maven](https://github.com/mvallim/java-fluent-validator/workflows/Java%20CI%20with%20Maven/badge.svg?branch=master)\n![CodeQL](https://github.com/mvallim/java-fluent-validator/workflows/CodeQL/badge.svg?branch=master)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=java-fluent-validator\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=java-fluent-validator)\n[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=java-fluent-validator\u0026metric=coverage)](https://sonarcloud.io/dashboard?id=java-fluent-validator)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.mvallim/java-fluent-validator/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.mvallim/java-fluent-validator)\n[![Hex.pm](https://img.shields.io/hexpm/l/plug.svg)](http://www.apache.org/licenses/LICENSE-2.0)\n\nValidating data is a common task that occurs throughout any application, especially the business logic layer. As for some quite complex scenarios, often the same or similar validations are scattered everywhere, thus it is hard to reuse code and break the [DRY](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself) rule.\n\n_**Compatible JDK 8, 11, 15, 16 and 17**_\n\nThis library supports **`Kotlin`** aswell\n\n## Sample\n\n### Java\n\n```java\nimport static br.com.fluentvalidator.predicate.ComparablePredicate.equalTo;\nimport static br.com.fluentvalidator.predicate.LogicalPredicate.not;\nimport static br.com.fluentvalidator.predicate.ObjectPredicate.nullValue;\nimport static br.com.fluentvalidator.predicate.StringPredicate.stringContains;\nimport static br.com.fluentvalidator.predicate.StringPredicate.stringEmptyOrNull;\n\nimport br.com.fluentvalidator.model.Boy\nimport br.com.fluentvalidator.model.Gender;\n\nimport br.com.fluentvalidator.AbstractValidator;\n\npublic class JavaValidatorBoy extends AbstractValidator\u003cBoy\u003e {\n\n  @Override\n  protected void rules() {\n\n    ruleFor(Boy::getGender)\n      .must(equalTo(Gender.MALE))\n      .when(not(nullValue()))\n        .withMessage(\"gender of boy must be MALE\")\n        .withFieldName(\"gender\")\n        .critical();\n\n    ruleFor(Boy::getName)\n      .must(stringContains(\"John\"))\n      .when(not(stringEmptyOrNull()))\n        .withMessage(\"child name must contains key John\")\n        .withFieldName(\"name\");\n  }\n\n}\n```\n\n### Kotlin\n\n```kotlin\nimport br.com.fluentvalidator.predicate.ComparablePredicate.equalTo;\nimport br.com.fluentvalidator.predicate.LogicalPredicate.not;\nimport br.com.fluentvalidator.predicate.ObjectPredicate.nullValue;\nimport br.com.fluentvalidator.predicate.StringPredicate.stringContains;\nimport br.com.fluentvalidator.predicate.StringPredicate.stringEmptyOrNull;\n\nimport br.com.fluentvalidator.model.Boy\nimport br.com.fluentvalidator.model.Gender;\n\nimport br.com.fluentvalidator.AbstractValidator;\n\nclass KotlinValidatorBoy : AbstractValidator\u003cBoy\u003e {\n\t\n  constructor() : super();\n\n  override fun rules() {\n\n    ruleFor(Boy::getGender)\n      .must(equalTo(Gender.MALE))\n      .`when`(not(nullValue()))\n        .withMessage(\"gender of boy must be MALE\")\n        .withFieldName(\"gender\")\n        .critical();\n\n    ruleFor(Boy::getName)\n      .must(stringContains(\"John\"))\n      .`when`(not(stringEmptyOrNull()))\n        .withMessage(\"child name must contains key John\")\n        .withFieldName(\"name\");\n  }\n\n}\n```\n\n## Index\n\n1. [Quick start](documentation/1-quick-start.md)\n   - [Step by Step](documentation/2-step-by-step.md)\n   - [Spring support](documentation/3-spring-support.md)\n2. [Validator](documentation/4-validator-methods.md)\n3. [Builder](documentation/5-builder-methods.md)\n4. [Predicate](documentation/6-predicate-methods.md)\n5. [ValidationResult](documentation/7-validation-methods.md)\n6. [PredicateBuilder](documentation/8-predicate-builder.md)\n7. [FunctionBuilder](documentation/9-function-builder.md)\n8. Examples\n   - [Samples](src/test/java/br/com/fluentvalidator/ValidatorTest.java)\n   - [Spring support samples](src/test/java/br/com/fluentvalidator/spring/ValidatorSpringTest.java)\n\n## Contributing\n\nPlease read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.\n\n## Versioning\n\nWe use [GitHub](https://github.com/mvallim/java-fluent-validator) for versioning. For the versions available, see the [tags on this repository](https://github.com/mvallim/java-fluent-validator/tags).\n\n## Authors\n\n* **Marcos Vallim** - *Founder, Author, Development, Test, Documentation* - [mvallim](https://github.com/mvallim)\n* **Paulo Sergio** - *Manteiner, Development, Test, Documentation* - [paulosergio-jnr](https://github.com/paulosergio-jnr)\n\nSee also the list of [contributors](CONTRIBUTORS.txt) who participated in this project.\n\n## License\n\nThis project is licensed under the Apache License - see the [LICENSE](LICENSE) file for details\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmvallim%2Fjava-fluent-validator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmvallim%2Fjava-fluent-validator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmvallim%2Fjava-fluent-validator/lists"}