Skip to content
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

Construct JLambdaMethodRef with JInvocation #56

Closed
heruan opened this issue Oct 24, 2017 · 1 comment
Closed

Construct JLambdaMethodRef with JInvocation #56

heruan opened this issue Oct 24, 2017 · 1 comment
Assignees
Labels

Comments

@heruan
Copy link
Contributor

heruan commented Oct 24, 2017

I need to generate this field signature:

public final StringFilter<E> firstName = this.andThen(Person::getFirstName)::apply;

I can easily generate the this.andThen(Person::getFirstName) part with:

JLambdaMethodRef lambdaMethod = new JLambdaMethodRef(personType, getterName);
JInvocation jInvocation = JExpr._this().invoke("andThen").arg(lambdaMethod);

but I can't generate a lambda method reference from this JInvocation, since I can't construct a new JLambdaMethodRef(jInvocation, "apply") nor I can generate a lambda reference with any JInvocation method, e.g. jInvocation.ref("apply") generates .apply instead of ::apply.

@phax phax self-assigned this Oct 25, 2017
@phax phax added the bug label Oct 25, 2017
@phax phax closed this as completed in #57 Oct 25, 2017
@phax
Copy link
Owner

phax commented Oct 25, 2017

I will add a test and complete the API before the release. Will be today or tomorrow!

phax added a commit that referenced this issue Oct 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants