static TypeResolver accordingTo(Type type) { return new TypeResolver().where(TypeMappingIntrospector.getTypeMappings(type)); }
/** * Returns type mappings using type parameters and type arguments found in the generic * superclass and the super interfaces of {@code contextClass}. */ static ImmutableMap<TypeVariable<?>, Type> getTypeMappings(Type contextType) { TypeMappingIntrospector introspector = new TypeMappingIntrospector(); introspector.visit(wildcardCapturer.capture(contextType)); return ImmutableMap.copyOf(introspector.mappings); }