Title: Feat: generic events · Issue #8 · MeteorDevelopment/orbit · GitHub
Open Graph Title: Feat: generic events · Issue #8 · MeteorDevelopment/orbit
X Title: Feat: generic events · Issue #8 · MeteorDevelopment/orbit
Description: Generic events would be really useful for avoiding repetitive if conditions at the beginning of an event handler, thus improving readability. A possible solution for this problem is a new typed event handler like @GenericEventHandler(So...
Open Graph Description: Generic events would be really useful for avoiding repetitive if conditions at the beginning of an event handler, thus improving readability. A possible solution for this problem is a new typed eve...
X Description: Generic events would be really useful for avoiding repetitive if conditions at the beginning of an event handler, thus improving readability. A possible solution for this problem is a new typed eve...
Opengraph URL: https://github.com/MeteorDevelopment/orbit/issues/8
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Feat: generic events","articleBody":"Generic events would be really useful for avoiding repetitive if conditions at the beginning of an event handler, thus improving readability.\r\n\r\nA possible solution for this problem is a new typed event handler like @GenericEventHandler(Something.class) and an IGenericEvent\u003cT\u003e interface with a getClass() method which returns Class\u003cT\u003e.\r\n\r\nAn example use case for typed events would be this:\r\n\r\n```java\r\n@GenericEventHandler(CustomPayloadS2CPacket.class)\r\nprivate void onPluginMessageReceive(GenericPacketEvent.Receive\u003cCustomPayloadS2CPacket\u003e event) {\r\n // event.packet is of type CustomPayloadS2CPacket at compile time\r\n}\r\n```\r\n\r\ninstead of\r\n\r\n```java\r\n@EventHandler\r\nprivate void onPluginMessageReceive(PacketEvent.Receive event) {\r\n if (!(event.packet instanceof CustomPayloadS2CPacket packet)) {\r\n return;\r\n }\r\n}\r\n```","author":{"url":"https://github.com/0x000006","@type":"Person","name":"0x000006"},"datePublished":"2024-11-22T13:04:11.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/8/orbit/issues/8"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:01385977-531c-5e9a-ab8d-81be0e664f5d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EAC8:3CEE15:1175F4:162077:697E78E1 |
| html-safe-nonce | 6a6e92338d3481c34695ec9c25330984642fd6a8a508b3310c93195e69c004de |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQUM4OjNDRUUxNToxMTc1RjQ6MTYyMDc3OjY5N0U3OEUxIiwidmlzaXRvcl9pZCI6IjI2NjgyNDEyNzA0MDQ0NDY0MzMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | ac4a45302dc07f4a81917ad163bb34160a6ca8f10e9d9d320ab00aee647e6f3c |
| hovercard-subject-tag | issue:2683126441 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/MeteorDevelopment/orbit/8/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2b20684cb7e22febf49841ed79df0870c469f44d7040e6bc53c3592a9799c768/MeteorDevelopment/orbit/issues/8 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2b20684cb7e22febf49841ed79df0870c469f44d7040e6bc53c3592a9799c768/MeteorDevelopment/orbit/issues/8 |
| og:image:alt | Generic events would be really useful for avoiding repetitive if conditions at the beginning of an event handler, thus improving readability. A possible solution for this problem is a new typed eve... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | 0x000006 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 60279d4097367e16897439d16d6bbe4180663db828c666eeed2656988ffe59f6 |
| turbo-cache-control | no-preview |
| go-import | github.com/MeteorDevelopment/orbit git https://github.com/MeteorDevelopment/orbit.git |
| octolytics-dimension-user_id | 73897938 |
| octolytics-dimension-user_login | MeteorDevelopment |
| octolytics-dimension-repository_id | 333119767 |
| octolytics-dimension-repository_nwo | MeteorDevelopment/orbit |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 333119767 |
| octolytics-dimension-repository_network_root_nwo | MeteorDevelopment/orbit |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7c85641c598ad130c74f7bcc27f58575cac69551 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width