{"id":15068904,"url":"https://github.com/auties00/reified","last_synced_at":"2025-04-10T16:51:25.804Z","repository":{"id":107125682,"uuid":"380738158","full_name":"Auties00/Reified","owner":"Auties00","description":"Reified in Java 11 and upwards","archived":false,"fork":false,"pushed_at":"2025-03-30T09:18:09.000Z","size":227,"stargazers_count":58,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-06T03:43:24.841Z","etag":null,"topics":["java","java11","java17","kotlin","reified"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Auties00.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2021-06-27T12:48:37.000Z","updated_at":"2025-03-30T09:18:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"8d9df0b7-93ca-4af5-8408-897d2b4443d1","html_url":"https://github.com/Auties00/Reified","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Auties00%2FReified","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Auties00%2FReified/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Auties00%2FReified/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Auties00%2FReified/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Auties00","download_url":"https://codeload.github.com/Auties00/Reified/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248255960,"owners_count":21073426,"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":["java","java11","java17","kotlin","reified"],"created_at":"2024-09-25T01:39:41.209Z","updated_at":"2025-04-10T16:51:25.794Z","avatar_url":"https://github.com/Auties00.png","language":"Java","readme":"# Reified\nReified in Java 11 and upwards\n\n### What is Reified\nReified is an Annotation for Java 11 and upwards inspired by the reified keyword in Kotlin.\nKotlin's approach requires the instruction to also be inlined, excluding as a result classes by design.\nThis library supports also classes instead as inlining is not needed.\nReified creates a local variable, or a parameter of type Class\u003cT\u003e for each type parameter annotated.\nThe correct type is deduced and passed to the tree that owns the type variable \nbased on the enclosing statements(ex. return statements and variable declarations) and the type parameters of the invocation.\nIf a non annotated type parameter is needed to determine the type of annotated one, Reified will take care of automatically applying\nthe same process to said parameters to determine the first.\n\n### How to install\n\n#### Maven\n```xml\n\u003cdependencies\u003e\n    \u003cdependency\u003e\n        \u003cgroupId\u003ecom.github.auties00\u003c/groupId\u003e\n        \u003cartifactId\u003ereified\u003c/artifactId\u003e\n        \u003cversion\u003e2.0\u003c/version\u003e\n    \u003c/dependency\u003e\n\u003c/dependencies\u003e\n\n\u003cbuild\u003e\n    \u003cplugins\u003e\n        \u003cplugin\u003e\n            \u003cgroupId\u003eorg.apache.maven.plugins\u003c/groupId\u003e\n            \u003cartifactId\u003emaven-compiler-plugin\u003c/artifactId\u003e\n            \u003cversion\u003e3.8.1\u003c/version\u003e\n            \u003cconfiguration\u003e\n                \u003cannotationProcessorPaths\u003e\n                    \u003cpath\u003e\n                        \u003cgroupId\u003ecom.github.auties00\u003c/groupId\u003e\n                        \u003cartifactId\u003ereified\u003c/artifactId\u003e\n                        \u003cversion\u003e2.0\u003c/version\u003e\n                    \u003c/path\u003e\n                \u003c/annotationProcessorPaths\u003e\n            \u003c/configuration\u003e\n        \u003c/plugin\u003e\n    \u003c/plugins\u003e\n\u003c/build\u003e\n```\n\n#### Gradle\n```groovy\nimplementation 'com.github.auties00:reified:2.0'\nannotationProcessor 'com.github.auties00:reified:2.0'\n```\n\n#### Plugins\nIn order to make linting work in your favourite IDE, a plugin is needed. \n\nMost common IDEs:\n1. IntelliJ - [IntelliJ Marketplace](https://plugins.jetbrains.com/plugin/17786-reified), [Source Code](https://github.com/Auties00/ReifiedIdeaPlugin)\n2. Eclipse - Not yet\n3. NetBeans - Not yet\n\n### Example\nWith reified:\n```java\nclass JsonUtils {\n    private static final ObjectMapper JACKSON = new ObjectMapper();\n\n    public static \u003c@Reified T\u003e T fromJson(String json){\n        try {\n            return JACKSON.readValue(json, T);\n        } catch (IOException exception) {\n            throw new UncheckedIOException(exception);\n        }\n    }\n}\n\nrecord ExampleObject(String name) {\n    public static ExampleObject fromJson(String json){\n        return JsonUtils.fromJson(json);\n    }\n}\n```\n\nWithout reified:\n\n```java\nimport java.io.IOException;\nimport java.io.UncheckedIOException;\n\nclass JsonUtils {\n    private static final ObjectMapper JACKSON = new ObjectMapper();\n\n    public static \u003cT\u003e T fromJson(String json, Class\u003cT\u003e clazz) {\n        try {\n            return JACKSON.readValue(json, clazz);\n        } catch (IOException exception) {\n            throw new UncheckedIOException(exception);\n        }\n    }\n}\n\nrecord ExampleObject(String name) {\n    public static ExampleObject fromJson(String json) {\n        return JsonUtils.fromJson(json, ExampleObject.class);\n    }\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fauties00%2Freified","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fauties00%2Freified","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fauties00%2Freified/lists"}