-
Notifications
You must be signed in to change notification settings - Fork 610
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
Support primitive function interfaces #1098
Comments
The level of complexity it would introduce to the current code base would probably be a bit disproportionate to the end benefit. However I did not have a proper chance to investigate it nor has it ever been requested. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When implementing some functions for Spring Cloud Stream, I noticed that it only supports functions that extend from Consumer, Supplier, and Function. Java 8 functions also has support for primitives with the use of interfaces such as IntConsumer, IntSupplier, IntFunction, and ToIntFunction. There are also long and double versions of each.
org.springframework.cloud.function.context.catalog.FunctionTypeUtils has a check in assertSupportedTypes that doesn't check for these other types.
I'd like to see these other interfaces supported so primitive types can be used without the need for boxing/unboxing. I've considered using boxed types, but do not like that approach due to performance impacts.
The text was updated successfully, but these errors were encountered: