{"id":22349719,"url":"https://github.com/crissnamon/aide","last_synced_at":"2025-06-12T02:38:55.442Z","repository":{"id":65738390,"uuid":"596234310","full_name":"CrissNamon/aide","owner":"CrissNamon","description":"Fast reflection, extended optionals and conditionals ","archived":false,"fork":false,"pushed_at":"2023-02-07T10:59:15.000Z","size":101,"stargazers_count":5,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2023-03-05T23:13:32.371Z","etag":null,"topics":["collaborate","communityexchange","conditional","framework","github","github-pages","java","jetbrains","jvm","lambda","library","optional","reflection","utils"],"latest_commit_sha":null,"homepage":"https://hiddenproject.tech/p/aide","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/CrissNamon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2023-02-01T18:48:11.000Z","updated_at":"2023-02-21T10:57:06.000Z","dependencies_parsed_at":"2023-02-19T16:45:44.080Z","dependency_job_id":null,"html_url":"https://github.com/CrissNamon/aide","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrissNamon%2Faide","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrissNamon%2Faide/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrissNamon%2Faide/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrissNamon%2Faide/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CrissNamon","download_url":"https://codeload.github.com/CrissNamon/aide/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228098321,"owners_count":17869033,"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":["collaborate","communityexchange","conditional","framework","github","github-pages","java","jetbrains","jvm","lambda","library","optional","reflection","utils"],"created_at":"2024-12-04T11:09:03.277Z","updated_at":"2024-12-04T11:09:03.805Z","avatar_url":"https://github.com/CrissNamon.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"## About\n\n[![Build](https://github.com/CrissNamon/aide/actions/workflows/maven.yml/badge.svg)](https://github.com/CrissNamon/aide/actions/workflows/maven.yml)\n[![Releases](https://img.shields.io/github/v/release/crissnamon/aide?include_prereleases)](https://github.com/CrissNamon/aide/releases)\n[![Maven](https://maven-badges.herokuapp.com/maven-central/tech.hiddenproject/aide/badge.svg)](https://central.sonatype.com/artifact/tech.hiddenproject/aide/1.2)\n\nAide is a set of useful utils for fast reflection, extended optionals and conditionals. It can help you with development\nof some service or your own framework.\n\n## Content\n\n#### Reflection\n\nAide reflection contains utils for reflection such as fast method invocation with lambda wrapping, annotation processing\nand other useful methods.\n\nReflective method calls with Aide are simple:\n\n```java\n// Get LambdaWrapperHolder isntance with default LambdaWrapper interface loaded\nLambdaWrapperHolder lambdaWrapperHolder = LambdaWrapperHolder.DEFAULT;\n// Find static method\nMethod staticMethod = ReflectionUtil.getMethod(TestClass.class, \"staticMethod\", String.class);\n// Wrap static method\n// LambdaWrapper - default wrapper interface from Aide\n// Void - caller class. In case of static method caller is not needed, so Void\n// Integer - return type\nMethodHolder\u003cLambdaWrapper, Void, Integer\u003e staticHolder = lambdaWrapperHolder.wrapSafe(staticMethod);\n// Invoke static method without caller\nint staticResult = staticHolder.invokeStatic(\"Hello\");\n```\n\n#### Optional\n\nAide optional contains extended optional classes for String, Boolean types, IfTrue and When conditionals, Object utils.\n\nExtended optionals provides new methods for some types:\n\n```java\nBooleanOptional.of(Modifier.isPublic(executable.getModifiers()))\n    .ifFalseThrow(() -\u003e ReflectionException.format(\"Wrapping is supported for PUBLIC methods only!\"));\n```\n\nWith conditionals you can make your code more functional. Thats how Aide reflection uses them:\n\n```java\nAbstractSignature signature = IfTrueConditional.create()\n    .ifTrue(exact).then(() -\u003e ExactMethodSignature.from(method))\n    .ifTrue(!exact).then(() -\u003e MethodSignature.from(method))\n    .orElseThrow(() -\u003e ReflectionException.format(\"%s undefined!\", exact));\n```\n\nOr WhenConditional:\n\n```java\nWhenConditional.create()\n    .when(someObj, Objects::nonNull).then(MyClass::nonNull)\n    .when(someObj, Objects::isNull).then(MyClass::isNull)\n    .orDoNothing();\n```\n\nSwitchConditional too:\n```java\nStatus status = Status.BAD_REQUEST;\nString message = SwitchConditional.\u003cStatus, String\u003eon(status)\n  .caseOn(Status.BAD_REQUEST::equals).thenGet(\"Error: Bad request\")\n  .caseOn(Status.INTERNAL_ERROR::equals).thenGet(\"Error: Internal error\")\n  .orElse(\"\");\n    \nassert message.equals(\"Error: Bad request\");\n    \nSwitchConditional.on(status)\n  // false = no break;, so all branches below will be executed\n  .caseOn(Status.BAD_REQUEST::equals, false).thenDo(this::action)\n  .caseOn(Status.INTERNAL_ERROR::equals).thenDo(this::action)\n  .orElseDo(() -\u003e System.out.println(\"No action\"));\n```\n\n## Use\n\nArtifact ids:\n\n- `tech.hiddenproject:aide-all` - all components\n- `tech.hiddenproject:aide-optional` - optionals and conditionals\n- `tech.hiddenproject:aide-reflection` - reflection utils\n\n### Maven\n\n```xml\n\n\u003cdependency\u003e\n  \u003cgroupId\u003etech.hiddenproject\u003c/groupId\u003e\n  \u003cartifactId\u003eaide-all\u003c/artifactId\u003e\n  \u003cversion\u003e1.3\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### Gradle\n\n```groovy\nimplementation 'tech:hiddenproject:aide-all:1.3'\n```\n\n## Resources\n\n___\n\n* Learn more at Aide [Wiki](https://github.com/CrissNamon/aide/wiki)\n* Look at some examples\n  in [example](https://github.com/CrissNamon/aide/tree/main/aide-all/src/main/java/tech/hiddenproject/aide/example)\n  package\n\n## Dependencies and source\n\n___\n\nAide has no dependencies and use only Java 8.\n\n## Repository info\n\n___\n\n* The main branch contains stable release\n* Development branch contains WIP code\n* Aide is released under version 2.0 of the [Apache License](https://www.apache.org/licenses/LICENSE-2.0)\n\n## Authors\n\n___\n\n* [Danila Rassokhin](https://gihub.com/crissnamon) [![Twitter](https://img.shields.io/twitter/follow/kpekepsalt_en?style=social)](https://twitter.com/kpekepsalt_en)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrissnamon%2Faide","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrissnamon%2Faide","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrissnamon%2Faide/lists"}