-
Notifications
You must be signed in to change notification settings - Fork 41.6k
PropertyMapper.from(value). #13837
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
PropertyMapper.from(value). #13837
Conversation
2d78148 to
2e6d26a
Compare
|
Thanks for the PR. I actually considered adding this method at the time but I was nervous about providing an overloaded version of a lambda method. I've seen a few people suggest that it's not good practice to do so. Perhaps we use a different method name instead? Maybe |
|
@philwebb Yes, you are right, but this could happen only for explicit Thoughts? Thanks. |
|
I'm at the limit of the knowledge on the subject and I can't remember who told me about it. I certainly like the feel of of not needing a different method name. I'll flag for team attention and see if there's a general consensus. |
|
@rstoyanchev @smaldini Was it either of you two that mentioned about not overloading lambda calls? Perhaps during some of the early reactor work? |
e54fd8a to
7f7e4fd
Compare
|
@philwebb I can remember that we actively avoided something slightly different in Reactor (that was a focus of the 3.1 release): avoid to provide several signatures that all take a functional interface with same number of parameters, eg. It is also better for integration into languages like Kotlin (cc @sdeleuze) to avoid functional interface overloads at all (as Kotlin has optional parameters, which brings back the ambiguity even with I don't think |
7f7e4fd to
893a052
Compare
* pr/13837: Polish "Add PropertyMapper.from(value)" Add PropertyMapper.from(value)
add a new method
PropertyMapper.from(value).