Returns the Invokable for constructor, which must be a member of T. @since 14.0
(Constructor<?> constructor)
| 639 | |
| 640 | |
| 641 | public final Invokable<T, T> constructor(Constructor<?> constructor) { |
| 642 | checkArgument(constructor.getDeclaringClass() == getRawType(), |
| 643 | "%s not declared by %s", |
| 644 | constructor, |
| 645 | getRawType()); |
| 646 | return new Invokable.ConstructorInvokable<T>(constructor) { |
| 647 | @Override |
| 648 | Type getGenericReturnType() { |
| 649 | return resolveType(super.getGenericReturnType()).getType(); |
| 650 | } |
| 651 | |
| 652 | @Override |
| 653 | Type[] getGenericParameterTypes() { |
| 654 | return resolveInPlace(super.getGenericParameterTypes()); |
| 655 | } |
| 656 | |
| 657 | @Override |
| 658 | Type[] getGenericExceptionTypes() { |
| 659 | return resolveInPlace(super.getGenericExceptionTypes()); |
| 660 | } |
| 661 | |
| 662 | @Override |
| 663 | public TypeToken<T> getOwnerType() { |
| 664 | return TypeToken.this; |
| 665 | } |
| 666 | |
| 667 | @Override |
| 668 | public String toString() { |
| 669 | return getOwnerType() + "(" + Joiner.on(", ").join(getGenericParameterTypes()) + ")"; |
| 670 | } |
| 671 | }; |
| 672 | } |
| 673 | |
| 674 | /** |
| 675 | * The set of interfaces and classes that {@code T} is or is a subtype of. {@link Object} is not |
nothing calls this directly
no test coverage detected