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.
I need to generate this field signature:
I can easily generate the
this.andThen(Person::getFirstName)
part with:but I can't generate a lambda method reference from this
JInvocation
, since I can't construct anew JLambdaMethodRef(jInvocation, "apply")
nor I can generate a lambda reference with anyJInvocation
method, e.g.jInvocation.ref("apply")
generates.apply
instead of::apply
.