{"id":21525935,"url":"https://github.com/junbong/idcache","last_synced_at":"2025-03-17T18:22:42.239Z","repository":{"id":30963988,"uuid":"34522148","full_name":"junbong/idcache","owner":"junbong","description":"idCache - Policy based identifier generator with cache","archived":false,"fork":false,"pushed_at":"2016-04-04T08:16:24.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-24T05:31:50.533Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/junbong.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":null,"support":null}},"created_at":"2015-04-24T14:05:52.000Z","updated_at":"2023-11-04T09:10:47.000Z","dependencies_parsed_at":"2022-09-08T18:20:23.181Z","dependency_job_id":null,"html_url":"https://github.com/junbong/idcache","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junbong%2Fidcache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junbong%2Fidcache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junbong%2Fidcache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junbong%2Fidcache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/junbong","download_url":"https://codeload.github.com/junbong/idcache/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244085024,"owners_count":20395523,"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":[],"created_at":"2024-11-24T01:41:07.902Z","updated_at":"2025-03-17T18:22:42.218Z","avatar_url":"https://github.com/junbong.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# idCache\nThe *idCache* is an policy based identifier generator with cache library written in Java. It is good for item store to giving a unique identifier value to each items. For example, you would like to set SID-stuff identifier- to each items for classify it. In this case, idCache is a good choice. It provides you highly abstracted value generator which take incremental policy.\n\n\n## Main Goals\n* Policy based\n* Non-duplicated, unique values\n* Concurrency\n* Stability\n\n\n## License\nReleased under the permissive [MIT License][].\n\n\n## Usage\n### Create simple incremental value generator\n```java\n// This idCache provides value with incrementing previous by 1\nIntIdCache cache = (IntIdCache) IdCaches.newIntIdentifierCacheBuilder()\n        // Set initial value - it begins with this value\n\t\t.setInitialValue(10000000)\n\t\t// Set maximum value - an action performed when value reached\n\t\t.setMaximumValue(19999999)\n\t\t// Set increasing policy\n\t\t.setIncreaser(new SequentialIntIncreaser(1))\n\t\t// Determine an action when maximum value reached\n\t\t.setLimitationPolicy(LimitationPolicy.THROW_EXCEPTION_POLICY)\n\t\t.build();\n\n// 10000000, 10000001, 10000002, 10000003…, 19999999\n// an exception occurred when value reached 20000000\n\n// Or simply,\n// (in this case, id range is 0 to 10000000)\nIntIdCache simpleCache = new IntIdCache(10000000, new SequentialIntIncreaser());\n\n// Or,\n// (id range 0 to Integer.MAX_VALUE)\nIntIdCache simplestCache = new IntIdCache();\n```\n\n### Create random-range incremental value generator\n```java\n// This idCache provides value with incrementing previous by RANDOM adder\nIntIdCache randomCache = new IntIdCache(10000000, 20000000, new RandomLeapIntIncreaser(1, 9));\n\n// 10000000, 10000005, 10000009, 10000012… 19999998\n```\n\n[MIT License]: https://github.com/Junbong/idcache/blob/master/LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjunbong%2Fidcache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjunbong%2Fidcache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjunbong%2Fidcache/lists"}