Package net.bytebuddy.description.type
Class TypeVariableToken
- java.lang.Object
-
- net.bytebuddy.description.type.TypeVariableToken
-
- All Implemented Interfaces:
ByteCodeElement.Token<TypeVariableToken>
public class TypeVariableToken extends java.lang.Object implements ByteCodeElement.Token<TypeVariableToken>
A tokenized representation of a type variable.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.bytebuddy.description.ByteCodeElement.Token
ByteCodeElement.Token.TokenList<S extends ByteCodeElement.Token<S>>
-
-
Field Summary
Fields Modifier and Type Field 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 Summary
Constructors Constructor 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.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method 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()
-
-
-
Field Detail
-
symbol
private final java.lang.String symbol
The type variable's symbol.
-
bounds
private final java.util.List<? extends TypeDescription.Generic> bounds
The type variable's upper bounds.
-
annotations
private final java.util.List<? extends AnnotationDescription> annotations
The annotations of the type variable.
-
-
Constructor Detail
-
TypeVariableToken
public TypeVariableToken(java.lang.String symbol, java.util.List<? extends TypeDescription.Generic> bounds)
Creates a new type variable token without annotations.- Parameters:
symbol
- The type variable's symbol.bounds
- The type variable's upper bounds.
-
TypeVariableToken
public TypeVariableToken(java.lang.String symbol, java.util.List<? extends TypeDescription.Generic> bounds, java.util.List<? extends AnnotationDescription> annotations)
Creates a new type variable token.- Parameters:
symbol
- The type variable's symbol.bounds
- The type variable's upper bounds.annotations
- The annotations of the type variable.
-
-
Method Detail
-
of
public static TypeVariableToken of(TypeDescription.Generic typeVariable, ElementMatcher<? super TypeDescription> matcher)
Transforms a type variable into a type variable token with its bounds detached.- Parameters:
typeVariable
- A type variable in its attached state.matcher
- A matcher that identifies types to detach from the upper bound types.- Returns:
- A token representing the detached type variable.
-
getSymbol
public java.lang.String getSymbol()
Returns the type variable's symbol.- Returns:
- The type variable's symbol.
-
getBounds
public TypeList.Generic getBounds()
Returns the type variable's upper bounds.- Returns:
- The type variable's upper bounds.
-
getAnnotations
public AnnotationList getAnnotations()
Returns the annotations on this type variable.- Returns:
- The annotations on this variable.
-
accept
public TypeVariableToken accept(TypeDescription.Generic.Visitor<? extends TypeDescription.Generic> visitor)
Transforms the types represented by this token by applying the given visitor to them.- Specified by:
accept
in interfaceByteCodeElement.Token<TypeVariableToken>
- Parameters:
visitor
- The visitor to transform all types that are represented by this token.- Returns:
- This token with all of its represented types transformed by the supplied visitor.
-
hashCode
@Enhance("hashCode") public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-