{"id":15487627,"url":"https://github.com/myconsciousness/catalog-api","last_synced_at":"2025-04-22T17:41:59.036Z","repository":{"id":50044458,"uuid":"289828235","full_name":"myConsciousness/catalog-api","owner":"myConsciousness","description":"The Catalog API provides an interface to give a common behavior to an Enum, such as searching for a specific Enum element based on the field value set in the Enum, or checking if a specific value is defined in the field of the Enum.","archived":false,"fork":false,"pushed_at":"2021-06-05T15:57:38.000Z","size":854,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-19T07:53:45.042Z","etag":null,"topics":["api","bicatalog-interface","catalog","catalog-api","constant","enum","gradle","interface","java"],"latest_commit_sha":null,"homepage":"https://myconsciousness.github.io/catalog-api/org/thinkit/api/catalog/package-summary.html","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/myConsciousness.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null}},"created_at":"2020-08-24T04:32:29.000Z","updated_at":"2024-04-02T17:47:30.000Z","dependencies_parsed_at":"2022-08-29T17:20:33.590Z","dependency_job_id":null,"html_url":"https://github.com/myConsciousness/catalog-api","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myConsciousness%2Fcatalog-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myConsciousness%2Fcatalog-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myConsciousness%2Fcatalog-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myConsciousness%2Fcatalog-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/myConsciousness","download_url":"https://codeload.github.com/myConsciousness/catalog-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250289078,"owners_count":21405913,"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":["api","bicatalog-interface","catalog","catalog-api","constant","enum","gradle","interface","java"],"created_at":"2024-10-02T06:41:11.896Z","updated_at":"2025-04-22T17:41:59.009Z","avatar_url":"https://github.com/myConsciousness.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Build](https://img.shields.io/badge/Build-Automated-2980b9.svg?style=for-the-badge)\n![Latest Version](https://img.shields.io/badge/Latest_Version-v1.0.3-27ae60.svg?style=for-the-badge)\n![License](https://img.shields.io/badge/License-Apache_2.0-e74c3c.svg?style=for-the-badge)\u003c/br\u003e\n![Java CI with Gradle](https://github.com/myConsciousness/catalog-api/workflows/Java%20CI%20with%20Gradle/badge.svg)\n\n# 1. Catalog API\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n**Table of Contents**\n\n- [1.1. What is it?](#11-what-is-it)\n- [1.2. Benefits](#12-benefits)\n- [1.3. How To Use](#13-how-to-use)\n  - [1.3.1. Add the dependencies](#131-add-the-dependencies)\n  - [1.3.2. Select interface you want to use](#132-select-interface-you-want-to-use)\n  - [1.3.3. Import and implement Enum with Catalog / BiCatalog interface](#133-import-and-implement-enum-with-catalog--bicatalog-interface)\n- [1.4. License](#14-license)\n- [1.5. More Information](#15-more-information)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n## 1.1. What is it?\n\n**_Make easier to maintain and use constants!_**\n\nThis is a Java-based API designed to make the constants group more maintainable and extensible.\u003cbr\u003e\nIt manages regularized constants as a single `catalog` and provides a convenient utility interface to manipulate the `catalog`.\n\n## 1.2. Benefits\n\n- It assumes the use of `Enum`\n- Necessary processes for constant operation are integrated in the interface\n- Useful common behaviors can be used anywhere\n- No need to use `public static final` constant classes anymore\n- **_Easy to maintain and use constants!_**\n\n## 1.3. How To Use\n\n### 1.3.1. Add the dependencies\n\n\u003e **_Note:_**\u003cbr\u003e\n\u003e Replace version you want to use. Check the latest [Packages](https://github.com/myConsciousness/catalog-api/packages).\u003cbr\u003e\n\u003e Please contact me for a token to download the package.\n\n**_Maven_**\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003eorg.thinkit.api.catalog\u003c/groupId\u003e\n  \u003cartifactId\u003ecatalog-api\u003c/artifactId\u003e\n  \u003cversion\u003ev1.0.3\u003c/version\u003e\n\u003c/dependency\u003e\n\n\u003cservers\u003e\n  \u003cserver\u003e\n    \u003cid\u003egithub\u003c/id\u003e\n    \u003cusername\u003emyConsciousness\u003c/username\u003e\n    \u003cpassword\u003exxxxxxxxxxxxxxxxxx\u003c/password\u003e\n  \u003c/server\u003e\n\u003c/servers\u003e\n```\n\n**_Gradle_**\n\n```gradle\nrepositories {\n    maven {\n        name = \"GitHubPackages\"\n        url = uri(\"https://maven.pkg.github.com/myConsciousness/catalog-api\")\n        credentials {\n          username = \"myConsciousness\"\n          password = \"xxxxxxxxxxxxxxxxxx\"\n        }\n    }\n}\n\ndependencies {\n    implementation 'org.thinkit.api.catalog:catalog-api:v1.0.3'\n}\n```\n\n### 1.3.2. Select interface you want to use\n\nThe `Catalog API` currently provides the following interfaces.\u003cbr\u003e\nChoose the interface you want to use depending on your needs.\n\n| Interface                                     | Overview                                                                                                                                                                                                                                                                                 |\n| --------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **_Catalog\u003cE extends Catalog\u003cE\u003e\u003e_**           | This is the basic catalog interface.\u003cbr\u003eElements of the concrete catalog class that implement this interface have a `code value`.\u003cbr\u003eYou can use the common behavior defined in the Catalog interface.                                                                                   |\n| **_BiCatalog\u003cE extends BiCatalog\u003cE, T\u003e, T\u003e_** | Each element of a concrete catalog class that implements this interface can have a `code value` plus a `value of any data type`.\u003cbr\u003eThe arbitrary data type is defined at the time of implementation of the concrete catalog class.\u003cbr\u003eYou can use the common behavior of the interface. |\n\n### 1.3.3. Import and implement Enum with Catalog / BiCatalog interface\n\n**_Catalog\u003cE extends Catalog\u003cE\u003e\u003e_**\n\n```java\nimport org.thinkit.api.catalog.Catalog;\n\n/**\n * Because the catalog applies the mechanism of recursive generics,\n * specify own type to the generics when implement the Catalog interface.\n */\npublic enum TestCatalog implements Catalog\u003cTestCatalog\u003e {\n\n    /**\n     * Catalog constants need unique code value as an parameter\n     */\n    TEST(0);\n\n    /**\n     * Required code value\n     */\n    private int code;\n\n    /**\n     * Simple constructor\n     */\n    TestCatalog(int code) {\n        this.code ＝ code;\n    }\n\n    @Override\n    public int getCode() {\n        return this.code;\n    }\n}\n```\n\n**_BiCatalog\u003cE extends BiCatalog\u003cE, T\u003e, T\u003e_**\n\n```java\nimport org.thinkit.api.catalog.BiCatalog;\n\n/**\n * Because the catalog applies the mechanism of recursive generics,\n * specify own type to the generics when implement the BiCatalog interface.\n */\npublic enum TestBiCatalog implements BiCatalog\u003cTestBiCatalog, String\u003e {\n\n    /**\n     * BiCatalog constants need unique code value and any tag value as parameters\n     */\n    TEST(0, \"test\");\n\n    /**\n     * Required code value\n     */\n    private int code;\n\n    /**\n     * Required tag value.\n     * The data type of the tag is the data type specified to generics when implement BiCatalog interface.\n     */\n    private String tag;\n\n    /**\n     * Simple constructor\n     */\n    TestCatalog(int code, String tag) {\n        this.code ＝ code;\n        this.tag ＝ tag;\n    }\n\n    @Override\n    public int getCode() {\n        return this.code;\n    }\n\n    @Override\n    public String getTag() {\n        return this.tag;\n    }\n}\n```\n\n## 1.4. License\n\n```\nCopyright 2020 Kato Shinya.\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except\nin compliance with the License. You may obtain a copy of the License at\n\n     http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under the License\nis distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express\nor implied. See the License for the specific language governing permissions and limitations under\nthe License.\n```\n\n## 1.5. More Information\n\n`Catalog API` was designed and implemented by Kato Shinya, who works as a freelance developer.\n\nRegardless of the means or content of communication, I would love to hear from you if you have any questions or concerns. I do not check my email box very often so a response may be delayed, anyway thank you for your interest!\n\n- [Creator Profile](https://github.com/myConsciousness)\n- [Creator Website](https://myconsciousness.github.io)\n- [License](https://github.com/myConsciousness/catalog-api/blob/master/LICENSE)\n- [Release Note](https://github.com/myConsciousness/catalog-api/releases)\n- [Package](https://github.com/myConsciousness/catalog-api/packages)\n- [File a Bug](https://github.com/myConsciousness/catalog-api/issues)\n- [Reference](https://myconsciousness.github.io/catalog-api/org/thinkit/api/catalog/package-summary.html)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmyconsciousness%2Fcatalog-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmyconsciousness%2Fcatalog-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmyconsciousness%2Fcatalog-api/lists"}