-
-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improvement: Support for common primitive functions (int, long, double) #34
Comments
That's a very good idea - targeting |
...just trying to figure out how to come up with some generator for them - maintaining all of these by hand is not realistic |
Indeed, that is plenty more work, which I'm trying for my own fork; not just refactor copy class and some interface renaming, but including subtle stuff like using Optional{primitive-name}, and some functional interfaces for primitives not having a super interface. |
For me, https://kevinbirch.github.io/string-template-maven-plugin/ looks promising for Maven driven code generation; the plugin looks old, but it maybe possible to cause it to use a newer https://www.stringtemplate.org/ version, if required. |
I implemented all of the primitive using functions in StringTemplates (*.st) files and many pom template reference entries at https://github.com/rwperrott/throwing-function using my fork of string-template-maven-plug at https://github.com/rwperrott/string-template-maven-plugin. The original string-template-maven-plugin somehow works from NetBeans 12, but fails with an interface incompatibility from IntelliJ IDEA 2020.1, so I enhanced it and upgraded the POM. |
For better or worse,
java.util.function
package has specific classes for primitives. I think it would make sense to have "feature parity" with the java provided functions, but wanted to hear if this would be something you're willing to look at a PR for before I spend a bit of time writing it.So a sort of simple example of what this change would allow:
Specifically I'd be looking to implement
Throwing
versions of:I imagined doing something like this for each of the above:
The text was updated successfully, but these errors were encountered: