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( |
| 643 | constructor.getDeclaringClass() == getRawType(), |
| 644 | "%s not declared by %s", |
| 645 | constructor, |
| 646 | getRawType()); |
| 647 | return new Invokable.ConstructorInvokable<T>(constructor) { |
| 648 | @Override |
| 649 | Type getGenericReturnType() { |
| 650 | return resolveType(super.getGenericReturnType()).getType(); |
| 651 | } |
| 652 | |
| 653 | @Override |
| 654 | Type[] getGenericParameterTypes() { |
| 655 | return resolveInPlace(super.getGenericParameterTypes()); |
| 656 | } |
| 657 | |
| 658 | @Override |
| 659 | Type[] getGenericExceptionTypes() { |
| 660 | return resolveInPlace(super.getGenericExceptionTypes()); |
| 661 | } |
| 662 | |
| 663 | @Override |
| 664 | public TypeToken<T> getOwnerType() { |
| 665 | return TypeToken.this; |
| 666 | } |
| 667 | |
| 668 | @Override |
| 669 | public String toString() { |
| 670 | return getOwnerType() + "(" + Joiner.on(", ").join(getGenericParameterTypes()) + ")"; |
| 671 | } |
| 672 | }; |
| 673 | } |
| 674 | |
| 675 | /** |
| 676 | * 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