public class TypeVariableToken extends java.lang.Object implements ByteCodeElement.Token<TypeVariableToken>
ByteCodeElement.Token.TokenList<S extends ByteCodeElement.Token<S>>
Modifier and Type | Field and Description |
---|---|
private java.util.List<? extends AnnotationDescription> |
annotations
The annotations of the type variable.
|
private java.util.List<? extends TypeDescription.Generic> |
bounds
The type variable's upper bounds.
|
private java.lang.String |
symbol
The type variable's symbol.
|
Constructor and Description |
---|
TypeVariableToken(java.lang.String symbol,
java.util.List<? extends TypeDescription.Generic> bounds)
Creates a new type variable token without annotations.
|
TypeVariableToken(java.lang.String symbol,
java.util.List<? extends TypeDescription.Generic> bounds,
java.util.List<? extends AnnotationDescription> annotations)
Creates a new type variable token.
|
Modifier and Type | Method and Description |
---|---|
TypeVariableToken |
accept(TypeDescription.Generic.Visitor<? extends TypeDescription.Generic> visitor)
Transforms the types represented by this token by applying the given visitor to them.
|
boolean |
equals(java.lang.Object other) |
AnnotationList |
getAnnotations()
Returns the annotations on this type variable.
|
TypeList.Generic |
getBounds()
Returns the type variable's upper bounds.
|
java.lang.String |
getSymbol()
Returns the type variable's symbol.
|
int |
hashCode() |
static TypeVariableToken |
of(TypeDescription.Generic typeVariable,
ElementMatcher<? super TypeDescription> matcher)
Transforms a type variable into a type variable token with its bounds detached.
|
java.lang.String |
toString() |
private final java.lang.String symbol
private final java.util.List<? extends TypeDescription.Generic> bounds
private final java.util.List<? extends AnnotationDescription> annotations
public TypeVariableToken(java.lang.String symbol, java.util.List<? extends TypeDescription.Generic> bounds)
symbol
- The type variable's symbol.bounds
- The type variable's upper bounds.public TypeVariableToken(java.lang.String symbol, java.util.List<? extends TypeDescription.Generic> bounds, java.util.List<? extends AnnotationDescription> annotations)
symbol
- The type variable's symbol.bounds
- The type variable's upper bounds.annotations
- The annotations of the type variable.public static TypeVariableToken of(TypeDescription.Generic typeVariable, ElementMatcher<? super TypeDescription> matcher)
typeVariable
- A type variable in its attached state.matcher
- A matcher that identifies types to detach from the upper bound types.public java.lang.String getSymbol()
public TypeList.Generic getBounds()
public AnnotationList getAnnotations()
public TypeVariableToken accept(TypeDescription.Generic.Visitor<? extends TypeDescription.Generic> visitor)
accept
in interface ByteCodeElement.Token<TypeVariableToken>
visitor
- The visitor to transform all types that are represented by this token.public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object