{"id":28456237,"url":"https://github.com/blumm96/gdscript-optional","last_synced_at":"2025-07-03T22:04:47.011Z","repository":{"id":296909318,"uuid":"994979463","full_name":"blumm96/gdscript-optional","owner":"blumm96","description":"A Java-style Optional\u003cT\u003e implementation for Godot Engine (GDScript).","archived":false,"fork":false,"pushed_at":"2025-06-02T21:18:04.000Z","size":37,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-29T10:39:40.611Z","etag":null,"topics":["gdscript","godot","optional","plugin"],"latest_commit_sha":null,"homepage":"","language":"GDScript","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/blumm96.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-02T19:27:16.000Z","updated_at":"2025-06-12T20:12:10.000Z","dependencies_parsed_at":"2025-06-03T09:44:28.394Z","dependency_job_id":"d1baa5a2-a2f5-4501-a89b-71d0b8a904c0","html_url":"https://github.com/blumm96/gdscript-optional","commit_stats":null,"previous_names":["blumm96/gdscript-optional"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/blumm96/gdscript-optional","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blumm96%2Fgdscript-optional","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blumm96%2Fgdscript-optional/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blumm96%2Fgdscript-optional/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blumm96%2Fgdscript-optional/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blumm96","download_url":"https://codeload.github.com/blumm96/gdscript-optional/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blumm96%2Fgdscript-optional/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263410760,"owners_count":23462295,"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":["gdscript","godot","optional","plugin"],"created_at":"2025-06-06T23:07:26.169Z","updated_at":"2025-07-03T22:04:46.936Z","avatar_url":"https://github.com/blumm96.png","language":"GDScript","readme":"## License\n\nThis project is licensed under the [MIT License](LICENSE).\n\n# Optional for Godot (GDScript)\n\nA Java-style `Optional\u003cT\u003e` implementation for Godot Engine (GDScript). Helps you safely wrap nullable values and avoid unsafe null checks.\n\n## Features\n\n- `Optional.of(value)` – requires a non-null value\n- `Optional.of_nullable(value)` – wraps value, allows null\n- `Optional.empty()` – explicitly empty optional\n- `unwrap()` – get the value or assert\n- `unwrap_or(default)` – get value or fallback\n- `map(func)` – transform value if present\n- `flat_map(func)` – transform with function returning Optional\n\n## Example\n\n```gdscript\nvar maybe_number = Optional.of_nullable(42)\nmaybe_number.if_present(func(v): print(\"Value is: \", v))\n\nvar result = maybe_number.map(func(v): return v * 2).unwrap_or(0)\nprint(result) # -\u003e 84\n```\n\n## Installation\n\n1. Copy the `addons/optional/` folder into your project.\n2. Enable the plugin in Project Settings → Plugins.\n3. Use `Optional` in your scripts.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblumm96%2Fgdscript-optional","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblumm96%2Fgdscript-optional","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblumm96%2Fgdscript-optional/lists"}