{"id":19260730,"url":"https://github.com/evant/typedbundle","last_synced_at":"2025-02-23T18:24:30.622Z","repository":{"id":25275915,"uuid":"28701547","full_name":"evant/typedbundle","owner":"evant","description":"Typesafe key-value parinings for Android Bundles.","archived":false,"fork":false,"pushed_at":"2020-06-14T22:52:30.000Z","size":73,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-05T09:44:13.358Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/evant.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-01-02T02:44:04.000Z","updated_at":"2021-02-10T17:19:11.000Z","dependencies_parsed_at":"2022-08-23T05:00:23.312Z","dependency_job_id":null,"html_url":"https://github.com/evant/typedbundle","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/evant%2Ftypedbundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evant%2Ftypedbundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evant%2Ftypedbundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evant%2Ftypedbundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/evant","download_url":"https://codeload.github.com/evant/typedbundle/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240357473,"owners_count":19788724,"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-09T19:22:42.799Z","updated_at":"2025-02-23T18:24:30.564Z","avatar_url":"https://github.com/evant.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"TypedBundle\n===========\n\nTypesafe key-value pairings for Android Bundles.\n\n## Usage\n\nThe idea here is extreamly simple. Instead of using string contants for you bundle's keys, you just use intances of `Key\u003cT\u003e` instead. This way the type of the value can be enforced at compile time.\n\n```java\nimport me.tatarka.typedbundle.Key;\n\npublic static final Key\u003cString\u003e EXTRA_NAME = new Key\u003c\u003e(\"name\");\npublic static final Key\u003cInteger\u003e EXTRA_AGE = new Key\u003c\u003e(\"age\");\n```\n\nYou can then use the `TypedBundle` wrapper class to put and get values from your Bundle.\n\n```java\nimport me.tatarka.typedbundle.TypedBundle;\n\nTypedBundle typedBundle = new TypedBundle()\n  .put(EXTRA_NAME, \"Bob\")\n  .put(EXTRA_AGE, 42);\nstartActivity(new Intent().putExtras(typedBundle.getBundle()));\n...\nTypedBundle typedBundle = new TypedBundle(getIntent().getExtras());\nString name = typedBundle.get(EXTRA_NAME);\nint age = typedBundle.get(EXTRA_AGE, 0); // defaults supported for any value.\n```\n\nThat's it! The values are stored in the bundle exactly how you'd expect so you can use this to interface with existing code no problem.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevant%2Ftypedbundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevant%2Ftypedbundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevant%2Ftypedbundle/lists"}