{"id":28044520,"url":"https://github.com/ololx/cranberry","last_synced_at":"2026-03-09T13:38:57.908Z","repository":{"id":42128821,"uuid":"256539436","full_name":"ololx/cranberry","owner":"ololx","description":" The cranberry is a java library that allows to write less code - it's automatically plugs into your project build         and sweets up your java.","archived":false,"fork":false,"pushed_at":"2023-09-18T17:59:12.000Z","size":6367,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-11T17:58:49.732Z","etag":null,"topics":["annotation-processing","annotation-processor","annotation-tool","annotations","code-generation","java","java-library","javac","maven"],"latest_commit_sha":null,"homepage":"","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/ololx.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":"2020-04-17T15:23:09.000Z","updated_at":"2025-02-20T19:18:38.000Z","dependencies_parsed_at":"2023-01-23T06:45:11.841Z","dependency_job_id":null,"html_url":"https://github.com/ololx/cranberry","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ololx%2Fcranberry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ololx%2Fcranberry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ololx%2Fcranberry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ololx%2Fcranberry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ololx","download_url":"https://codeload.github.com/ololx/cranberry/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253609623,"owners_count":21935558,"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":["annotation-processing","annotation-processor","annotation-tool","annotations","code-generation","java","java-library","javac","maven"],"created_at":"2025-05-11T17:59:02.448Z","updated_at":"2026-03-09T13:38:57.831Z","avatar_url":"https://github.com/ololx.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cranberry\n\n```\n             ___/\\\\ /\\  \n            / _//| \\ /  \n           / / / |/ \\__ 000   000\n           |/ /  / /  000       000\n      00 00 _/   |/ 000       ^   000\n   00 ^     00   | 000     \u003c  *  \u003e 000  \n  00\u003c * \u003e    00 0 0 000       v   000\n   00 v     00 0 * 0  000       000\n      00 00     0 0     000   000\n________________________________________\nCranberry          \n```\n\nThe Cranberry is a java library that allows to write less routine code. It's automatically plugs into you build during compilation and sweets up your project.\n\n[![Maven Central](https://img.shields.io/maven-central/v/io.github.ololx.cranberry/cranberry.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22io.github.ololx.cranberry%22) [![Sonatype Nexus Release](https://img.shields.io/nexus/r/io.github.ololx.cranberry/cranberry?label=Nexus%20Release\u0026nexusVersion=2\u0026server=https%3A%2F%2Fs01.oss.sonatype.org)](https://search.maven.org/search?q=g:%22io.github.ololx.cranberry%22)\n[![Sonatype Nexus Snapshot](https://img.shields.io/nexus/s/io.github.ololx.cranberry/cranberry?label=Nexus%20Snapshot\u0026server=https%3A%2F%2Fs01.oss.sonatype.org)](https://search.maven.org/search?q=g:%22io.github.ololx.cranberry%22) [![javadoc](https://javadoc.io/badge2/io.github.ololx.cranberry/cranberry/javadoc.svg?logo=java)](https://javadoc.io/doc/io.github.ololx.cranberry) \n\n[![tag](https://img.shields.io/github/v/tag/ololx/cranberry?style=flat\u0026include_prereleases\u0026logo=github)](https://github.com/ololx/cranberry/tags) [![release](https://img.shields.io/github/v/release/ololx/cranberry?style=flat\u0026include_prereleases\u0026logo=github)](https://github.com/ololx/cranberry/releases)\n\n[![osslifecycle](https://img.shields.io/osslifecycle/ololx/cranberry?style=flat)](OSSMETADATA) [![last_commit](https://img.shields.io/github/last-commit/ololx/cranberry?style=flat\u0026logo=github)](https://github.com/ololx/cranberry/commits) [![release_date](https://img.shields.io/github/release-date/ololx/cranberry?style=flat\u0026logo=github)](https://github.com/ololx/cranberry/releases) \n\n[![DeepSource](https://deepsource.io/gh/ololx/cranberry.svg/?label=active+issues\u0026show_trend=true\u0026token=fKuT1NGwxvQWyqxHxzRDvAYS)](https://deepsource.io/gh/ololx/cranberry/?ref=repository-badge) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/3cdf2b4dacbe445ca4ccfd0db41e4968)](https://www.codacy.com/gh/ololx/cranberry/dashboard?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=ololx/cranberry\u0026amp;utm_campaign=Badge_Grade)\n\n[![licence](https://img.shields.io/github/license/ololx/cranberry?style=flat)](LICENCE) [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg?style=flat)](CODE_OF_CONDUCT.md) [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fololx%2Fcranberry.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fololx%2Fcranberry?ref=badge_shield)\n\n![repo_size](https://img.shields.io/github/repo-size/ololx/cranberry?style=flat\u0026logo=github) ![languages_code_size](https://img.shields.io/github/languages/code-size/ololx/cranberry?style=flat\u0026logo=github) ![languages_count](https://img.shields.io/github/languages/count/ololx/cranberry?style=flat\u0026logo=github) ![languages_top](https://img.shields.io/github/languages/top/ololx/cranberry?style=flat\u0026logo=github)\n\n[![requires_java](https://img.shields.io/badge/requires_java-1.8+-important)](https://www.oracle.com/java/technologies/javase-jdk8-downloads.html)\n\n## 📇 Table of Contents\n\n- [About](#about)\n- [Demo](#demo)\n- [Features](#feature)\n- [Getting Started](#getting-started)\n- [Built With](#built-with)\n- [Contributing](#contributing)\n- [Code of Conduct](#code-of-conduct)\n- [Versioning](#versioning)\n- [Authors](#authors)\n- [Licensing](#licensing)\n\n##  📖 About\n\nThe Cranberry is a java library that allows to write less routine code. It's automatically plugs into you build during compilation and sweets up your project. \n\n### Motivation\n\nSometimes it wants frequently used code to be generated automatically. Especially if such code is not generated by existing libraries.\n\n### Modules\n\nThe cranberry project includes the follows modules:\n\n- [cranberry commons](cranberry-commons/README.md) - this module provides a general realisation of simple tools and wrappers which are used in another cranberry modules for the automatically code generating during compilation;\n- [cranberry muffin](cranberry-muffin/README.md) - this module  is designed to combine the possibilities of thematically grouped modules into one common library;\n- [cranberry statement](cranberry-statement/README.md) - this module provides an api for the statements validation (such as not null and e.t.c.). This module includes an annotations for the injecting methods of this api into code during compilation;\n- [cranberry logging](cranberry-logging/README.md) - this module provides an api for the loggint method params;\n- [cranberry data](cranberry-data/README.md) - this module provides an api for the java data manipulations: varianbles modifiers, default values, e.t.c. This module includes an annotations for the injecting methods of this api into code during compilation;\n- [cranberry tests](cranberry-tests/README.md) - this module contains the unit tests for the remaining modules of the cranberry project.\n\n## 📸 Demo\n\nThe demonstration shows how `cranberry` helps to write less code on the checking parameters implementation example for non-emptiness via usage of the `@ NotEmpty` annotation from the `cranberry-statement` module. This is one of opportunities which cranberry provides.\n\n![The demo of cranberry statement usage](https://github.com/ololx/cranberry/blob/assets/demo/cranberry-statements-not-blank-demo-1.gif?raw=true)\n\n## 🎚 Features\n\n- The api for the statements validation about not null values of the `Object` type;\n- The api for the statements validation about not empty values of the `Map` type, the `Collection` type, the `Array` and the `String` type;\n- The api for the statements validation about not blank values of the `String` type; \n- The api for the loggint method params;\n- The annotations for the injecting methods of this api into code during compilation.\n\n### To Do\n\n- For more information on an upcoming development, please read the [todo](TODO.md) list.\n\n### Changelog\n\n- For more information on a releases, a features and a changes, please read the [changelog](CHANGELOG.md) notes.\n\n## 🚦 Getting Started\n\nThese instructions allow to get a copy of this project and run it on a local machine.\n\n### Prerequisites\n\nBefore using it, make sure that follows software are installed on the local machine:\n\n- **[Oracle JDK 8+](https://www.oracle.com/java/technologies/javase-downloads.html)** - the java development kit.\n\n### Installing\n\n#### Using Maven\n\nIn order to add cranberry to your project it is quite simple to:\n\n1 - Add this dependency to classpath in pom:\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eio.github.ololx.cranberry\u003c/groupId\u003e\n    \u003cartifactId\u003e${module-name}\u003c/artifactId\u003e\n    \u003cversion\u003e${version}\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n_Example of dependency for installing `cranberry-muffin` module with version `0.5.3` is presented bellow_\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eio.github.ololx.cranberry\u003c/groupId\u003e\n    \u003cartifactId\u003ecranberry-muffin\u003c/artifactId\u003e\n    \u003cversion\u003e0.5.3\u003c/version\u003e\n    \u003cscope\u003eprovided\u003c/scope\u003e\n\u003c/dependency\u003e\n```\n\n2 - Execute this with goal\n\n```bash\nclean install\n```\n\n### Cloning\n\nFor the cloning this repository to a local machine, just use the follows link:\n\n```https\nhttps://github.com/ololx/cranberry\n```\n\n### Using\n\nThe simple example below presents the the checking of a parameters on `not null` value without the specific exception message returns and  `not blank` value with the specific exception message returns.\n\n```java\n ...\n//Add the checking statements for method params\npublic List\u003cSomeDetail\u003e findSomeDetailbyUidAndTypeCode(@NotNull Long uid, \n    @NotEmpty(\"The Type Code must be not empty\") String typeCode) {\n    return Collections.EMPTY_LIST;\n}\n...\n```\n\nThe simple example below presents the the logging of a parameters of method with the specific message.\n\n```java\n...\n/**\n * The example of {@code @LogParam} annotation usage on {@code List\u003cString\u003e param}.\n * \u003cp\u003e\n * When this method is called, the parameters will be displayed in the log;\n * Messages in the log will label the format {@char \"message param\"} for each parameter.\n */\n@LogParam(message = \"Start execution with param =\")\npublic static void runWithCustomMessage(List\u003cString\u003e param) {\n    param.stream()\n            .forEach(eachParam -\u003e {\n                System.out.println(eachParam);\n            });\n}\n...\n```\n\n## 🛠 Built With\n\n- **[Maven](https://maven.apache.org/)** - Dependency Management.\n\n## 🎉 Contributing\n\nIf you want to contribute this project - you are welcome and have fun.\nPlease visit the [contributing](CONTRIBUTING.md) section for details on this code of conduct, and the process for submitting pull requests.\n\n## 📝 Code of Conduct\n\nIn order to ensure that all is welcoming, please review and abide by the [code of conduct](CODE_OF_CONDUCT.md).\n\n## 🗒 Versioning\n\nFor the versioning is used [Semantic Versioning](http://semver.org/). For the versions available, see the [changelog](CHANGELOG.md) or the tags on this repository.\n\n## ©️ Authors\n\n* **Alexander A. Kropotin** - *Initial work* - [ololx](https://github.com/ololx).\n\n## 🔏 Licensing\n\nThis project is licensed under the Apache license version 2.0 - see the [lisence](LICENSE) document for details.\n\n\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fololx%2Fcranberry.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fololx%2Fcranberry?ref=badge_large)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fololx%2Fcranberry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fololx%2Fcranberry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fololx%2Fcranberry/lists"}