Open TobiasRoland opened 5 years ago
That's a very good idea - targeting 2.0.0
...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: