/** * {@inheritDoc} */ public TypeVariableDefinition<U> typeVariable(String symbol, Collection<? extends TypeDefinition> bounds) { return new TypeVariableDefinitionAdapter(new TypeVariableToken(symbol, new TypeList.Generic.Explicit(new ArrayList<TypeDefinition>(bounds)))); }
/** * {@inheritDoc} */ public TypeVariableToken accept(TypeDescription.Generic.Visitor<? extends TypeDescription.Generic> visitor) { return new TypeVariableToken(symbol, getBounds().accept(visitor), annotations); }
/** * Transforms a type variable into a type variable token with its bounds detached. * * @param typeVariable A type variable in its attached state. * @param matcher A matcher that identifies types to detach from the upper bound types. * @return A token representing the detached type variable. */ public static TypeVariableToken of(TypeDescription.Generic typeVariable, ElementMatcher<? super TypeDescription> matcher) { return new TypeVariableToken(typeVariable.getSymbol(), typeVariable.getUpperBounds().accept(new TypeDescription.Generic.Visitor.Substitutor.ForDetachment(matcher)), typeVariable.getDeclaredAnnotations()); }