Returns the Invokable for method, which must be a member of T. @since 14.0
(Method method)
| 599 | |
| 600 | |
| 601 | public final Invokable<T, Object> method(Method method) { |
| 602 | checkArgument(this.someRawTypeIsSubclassOf(method.getDeclaringClass()), |
| 603 | "%s not declared by %s", |
| 604 | method, |
| 605 | this); |
| 606 | return new Invokable.MethodInvokable<T>(method) { |
| 607 | @Override |
| 608 | Type getGenericReturnType() { |
| 609 | return resolveType(super.getGenericReturnType()).getType(); |
| 610 | } |
| 611 | |
| 612 | @Override |
| 613 | Type[] getGenericParameterTypes() { |
| 614 | return resolveInPlace(super.getGenericParameterTypes()); |
| 615 | } |
| 616 | |
| 617 | @Override |
| 618 | Type[] getGenericExceptionTypes() { |
| 619 | return resolveInPlace(super.getGenericExceptionTypes()); |
| 620 | } |
| 621 | |
| 622 | @Override |
| 623 | public TypeToken<T> getOwnerType() { |
| 624 | return TypeToken.this; |
| 625 | } |
| 626 | |
| 627 | @Override |
| 628 | public String toString() { |
| 629 | return getOwnerType() + "." + super.toString(); |
| 630 | } |
| 631 | }; |
| 632 | } |
| 633 | |
| 634 | /** |
| 635 | * Returns the {@link Invokable} for {@code constructor}, which must be a member of {@code T}. |
nothing calls this directly
no test coverage detected