{"id":20900068,"url":"https://github.com/thiagogarbazza/violation-builder","last_synced_at":"2026-05-25T15:03:28.589Z","repository":{"id":39536268,"uuid":"198297918","full_name":"thiagogarbazza/violation-builder","owner":"thiagogarbazza","description":"A small java library for building violations.","archived":false,"fork":false,"pushed_at":"2022-06-24T13:33:39.000Z","size":51,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-21T05:02:54.479Z","etag":null,"topics":["builder","java","violation","violation-builder"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thiagogarbazza.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-07-22T20:32:40.000Z","updated_at":"2021-11-17T10:09:37.000Z","dependencies_parsed_at":"2022-09-20T03:53:59.473Z","dependency_job_id":null,"html_url":"https://github.com/thiagogarbazza/violation-builder","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiagogarbazza%2Fviolation-builder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiagogarbazza%2Fviolation-builder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiagogarbazza%2Fviolation-builder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiagogarbazza%2Fviolation-builder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thiagogarbazza","download_url":"https://codeload.github.com/thiagogarbazza/violation-builder/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243285620,"owners_count":20266849,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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","java","violation","violation-builder"],"created_at":"2024-11-18T11:17:55.590Z","updated_at":"2025-12-25T15:43:27.431Z","avatar_url":"https://github.com/thiagogarbazza.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# violation-builder\n\nA small java library for building violations.\n\n[![Build Status](https://api.travis-ci.com/thiagogarbazza/violation-builder.svg?branch=master)](https://app.travis-ci.com/thiagogarbazza/violation-builder)\n[![Coverage Status](https://sonarcloud.io/api/project_badges/measure?project=com.github.thiagogarbazza:violation-builder\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=com.github.thiagogarbazza:violation-builder)\n[![Coverage Status](https://sonarcloud.io/api/project_badges/measure?project=com.github.thiagogarbazza:violation-builder\u0026metric=coverage)](https://sonarcloud.io/dashboard?id=com.github.thiagogarbazza:violation-builder)\n\n## Usage samples\n\n```java\nvoid example() throws ViolationException {\n  boolean condition = true;\n\n  ViolationBuilder.builder()\n    .error(condition,\"error-key\", () -\u003e \"some error message.\")\n    .warning(condition,\"waring-key\", () -\u003e \"some warning message.\")\n    .buildIgnoreWarnings();\n}\n```\n\nAppends to the builder a violations of error type.\n\n```java\nvoid example() throws ViolationException {\n  boolean condition = true;\n\n  ViolationBuilder.builder()\n    .error(condition, \"error-key-01\", \"some error-01 message.\")\n    .error(\"error-key-02\", \"some error-02 message.\")\n    .error(condition,\"error-key-03\", () -\u003e \"some error-03 message.\")\n    .error(\"error-key-04\", () -\u003e \"some error-04 message.\")\n    .build();\n}\n```\n\nAppends to the builder a violations of warning type.\n\n```java\nvoid example() throws ViolationException {\n  boolean condition = true;\n\n  ViolationBuilder.builder()\n    .warning(condition, \"waring-key-01\", \"some waring-01 message.\")\n    .warning(\"waring-key-02\", \"some waring-02 message.\")\n    .warning(condition,\"waring-key-03\", () -\u003e \"some warning-03 message.\")\n    .warning(\"waring-key-04\", () -\u003e \"some warning-04 message.\")\n    .build();\n}\n```\n\nExecuting a collection of validation rules\n\n```java\nfinal Collection\u003cValidationRule\u003cObject\u003e\u003e rules = Arrays.asList(\n  new ValidationRuleContinueFlow\u003cObject\u003e() {\n    @Override\n    public void runContinueFlow(ViolationBuilder violationBuilder, Object data) {\n      violationBuilder.warning(/* validation on the data */, \"waring-key-01\", \"some waring-01 message.\");\n    }\n  },\n  new ValidationRuleStopFlow\u003cObject\u003e() {\n    @Override\n    public void runStopFlow(ViolationBuilder violationBuilder, Object data) {\n      violationBuilder.error(/* validation on the data */, \"error-key-01\", \"some error-01 message.\");\n    }\n  },\n  new ValidationRuleContinueFlow\u003cObject\u003e() {\n    @Override\n    public void runContinueFlow(ViolationBuilder violationBuilder, Object data) {\n      violationBuilder.error(/* validation on the data */, \"error-key-02\", \"some error-02 message.\");\n    }\n  },\n  new ValidationRule\u003cObject\u003e() {\n    @Override\n    public Rulesflow run(ViolationBuilder violationBuilder, Object data) {\n      violationBuilder.error(/* validation on the data */, \"error-key-03\", \"some error-03 message.\");\n      return Rulesflow.CONTINUE;\n    }\n  }\n);\n\nRulesExecutor.rulesExecutor(rules, data);\n```\n\n## Installing\n\nAvailable in the [Maven Central repository].\n\nAdd a dependency to `com.github.thiagogarbazza:violation-builder` in your project.\n\nExample using maven:\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.github.thiagogarbazza\u003c/groupId\u003e\n  \u003cartifactId\u003eviolation-builder\u003c/artifactId\u003e\n  \u003cversion\u003e1.2.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## Built With\n\n- [Java](https://www.java.com/) - The lang used\n- [Junit](https://junit.org/junit5/) - The framework test used\n- [Maven](https://maven.apache.org/) - Dependency Management\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 [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository].\n\n## Authors\n\n- **[Thiago Garbazza](https://github.com/thiagogarbazza)** - *Initial work*\n\nSee also the list of [contributors] who participated in this project.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.\n\n## Acknowledgments\n\n- Java 8+\n- Junit jupter\n\n[contributors]: (https://github.com/thiagogarbazza/violation-builder/contributors)\n[tags on this repository]: https://github.com/thiagogarbazza/violation-builder/tags\n[Maven Central repository]: http://mvnrepository.com/artifact/com.github.thiagogarbazza/violation-builder\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthiagogarbazza%2Fviolation-builder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthiagogarbazza%2Fviolation-builder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthiagogarbazza%2Fviolation-builder/lists"}