MCPcopy Create free account
hub / github.com/antlr/codebuff / constructor

Method constructor

output/java_guava/1.4.17/TypeToken.java:641–672  ·  view source on GitHub ↗

Returns the Invokable for constructor, which must be a member of T. @since 14.0

(Constructor<?> constructor)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

getRawTypeMethod · 0.95
checkArgumentMethod · 0.45
getDeclaringClassMethod · 0.45

Tested by

no test coverage detected