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

Method getGenericInterfaces

output/java_guava/1.4.19/TypeToken.java:335–349  ·  view source on GitHub ↗

Returns the generic interfaces that this type directly implements. This method is similar but different from Class#getGenericInterfaces(). For example, new TypeToken >() {.getGenericInterfaces()} will return a list that contains {@code new TypeToken<Iterable<Strin

()

Source from the content-addressed store, hash-verified

333 */
334
335 final ImmutableList<TypeToken<? super T>> getGenericInterfaces() {
336 if (runtimeType instanceof TypeVariable) {
337 return boundsAsInterfaces(((TypeVariable<?>) runtimeType).getBounds());
338 }
339 if (runtimeType instanceof WildcardType) {
340 return boundsAsInterfaces(((WildcardType) runtimeType).getUpperBounds());
341 }
342 ImmutableList.Builder<TypeToken<? super T>> builder = ImmutableList.builder();
343 for (Type interfaceType : getRawType().getGenericInterfaces()) {
344 @SuppressWarnings("unchecked") // interface of T
345 TypeToken<? super T> resolvedInterface = (TypeToken<? super T>) resolveSupertype(interfaceType);
346 builder.add(resolvedInterface);
347 }
348 return builder.build();
349 }
350
351
352 private ImmutableList<TypeToken<? super T>> boundsAsInterfaces(Type[] bounds) {

Callers 2

getInterfacesMethod · 0.45
visitClassMethod · 0.45

Calls 8

boundsAsInterfacesMethod · 0.95
builderMethod · 0.95
getRawTypeMethod · 0.95
resolveSupertypeMethod · 0.95
addMethod · 0.65
getBoundsMethod · 0.45
getUpperBoundsMethod · 0.45
buildMethod · 0.45

Tested by

no test coverage detected