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

Method constructor

output/java_guava/1.4.19/TypeToken.java:641–673  ·  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(
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

Callers

nothing calls this directly

Calls 3

getRawTypeMethod · 0.95
checkArgumentMethod · 0.45
getDeclaringClassMethod · 0.45

Tested by

no test coverage detected