Skip to content

Allow omitting parameters in WrapMethod handler #110

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

contariaa
Copy link

When wrapping many methods with the same logic without modifying their parameters (for example for synchronization), it would be useful to be able to omit specifiying parameters to be able to target many methods with differing parameters with a single handler.
This is similar to @Inject allowing params to be left out.

The behaviour works as follows:
If there is an exception when checking the target params and the first handler param is of type Operation, captureParams will be set to false.
If captureParams is false:

  • Parameters are passed to lamba creation instead of the handler method
  • The bridge method will be generated with bound parameters, then the method parameters, then Object[]
  • The object array passed through Operation#call will be enforced to be empty
  • The passed params are loaded instead of the array elements

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant