{"id":13605922,"url":"https://github.com/Jintin/TypedBundle","last_synced_at":"2025-04-12T05:35:07.821Z","repository":{"id":191340698,"uuid":"684450428","full_name":"Jintin/TypedBundle","owner":"Jintin","description":"Type safe Bundle for Android development","archived":false,"fork":false,"pushed_at":"2023-12-04T06:52:02.000Z","size":173,"stargazers_count":27,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-08-02T19:38:48.877Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","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/Jintin.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,"governance":null}},"created_at":"2023-08-29T06:37:46.000Z","updated_at":"2024-04-09T12:27:17.000Z","dependencies_parsed_at":"2023-11-24T07:23:19.091Z","dependency_job_id":"8557e033-ee11-44d5-b300-0a00990bcdaa","html_url":"https://github.com/Jintin/TypedBundle","commit_stats":null,"previous_names":["jintin/typedbundle"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jintin%2FTypedBundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jintin%2FTypedBundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jintin%2FTypedBundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jintin%2FTypedBundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jintin","download_url":"https://codeload.github.com/Jintin/TypedBundle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223498092,"owners_count":17155257,"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-08-01T19:01:04.261Z","updated_at":"2024-11-07T10:31:30.349Z","avatar_url":"https://github.com/Jintin.png","language":"Kotlin","funding_links":[],"categories":["Kotlin"],"sub_categories":[],"readme":"# TypedBundle\n\n[![CircleCI](https://dl.circleci.com/status-badge/img/gh/Jintin/TypedBundle/tree/master.svg?style=shield)](https://dl.circleci.com/status-badge/redirect/gh/Jintin/TypedBundle/tree/master) [![Maven Central](https://img.shields.io/maven-central/v/io.github.jintin/typed-bundle)](https://mvnrepository.com/artifact/io.github.jintin/typed-bundle)\n\nA type safe `Bundle` for Android development.\n\n`Bundle` is essential component in Android development from Day 1, but the flexible key-value structure don't limiting us from put a `String` and get an `Int` back with same key (and which will cause crash not compile error). This library is aimed to transform the plain String key into a type based class (such as `StringKey` or `IntKey` in below example) to align the type usage on both get and set side.\nAnd the wrapper class (`StringKey` or `IntKey` for example) will be replace to actual String after compiled thanks to kotlin `value class` so no additional overhead.\n## Install\n\n```kotlin\ndependencies {\n    implementation(\"io.github.jintin:typed-bundle:0.5.0\")\n}\n```\n\n## Usage\n\n```kotlin\nval textKey = StringKey(\"SomeStringKey\")\nval intKey = IntKey(\"SomeIntKey\")\nval bundle = Bundle()\n\n// Bundle usage\nbundle[textKey] = \"Some text\"         // only String value is allowed\nbundle[intKey] = 12345                // only Int value is allowed\n\nval text = bundle.get(textKey, \"\")    // guarantee result to be a String\nval text = bundle[textKey]            // guarantee result to be a String?\nval int = bundle.get(intKey, -1)      // guarantee result to be an Int\nval int = bundle[intKey]              // guarantee result to be an Int\n\n// Intent usage\nintent.putExtra(textKey, \"Some text\") // only String value is allowed\nintent.putExtra(intKey, 12345)        // only Int value is allowed\n\nval text = intent.getExtra(textKey)   // guarantee result to be a String?  \nval int = intent.getExtra(intKey, -1) // guarantee result to be an Int\n```\n\nYou can go to ./app module for more information.\n\n## License\n\n**TypedBundle** is released under Apache License 2.0.\nSee [LICENSE](https://github.com/Jintin/TypedBundle/blob/master/LICENSE) for more details.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJintin%2FTypedBundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJintin%2FTypedBundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJintin%2FTypedBundle/lists"}