Package io.github.classgraph
Class TypeVariableSignature
java.lang.Object
io.github.classgraph.HierarchicalTypeSignature
io.github.classgraph.TypeSignature
io.github.classgraph.ReferenceTypeSignature
io.github.classgraph.ClassRefOrTypeVariableSignature
io.github.classgraph.TypeVariableSignature
A type variable signature.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
Compare base types, ignoring generic type parameters.getName()
Get the name of the type variable.int
hashCode()
resolve()
Look up a type variable (e.g.toString()
Render to string.Render to string, using only simple names for classes.Returns the type variable along with its type bound, if available (e.g.Methods inherited from class io.github.classgraph.TypeSignature
getTypeAnnotationInfo
-
Method Details
-
getName
Get the name of the type variable.- Returns:
- The type variable name.
-
resolve
Look up a type variable (e.g. "T") in the defining method and/or enclosing class' type parameters, and return the type parameter with the same name (e.g. "T extends com.xyz.Cls").- Returns:
- the type parameter (e.g. "T extends com.xyz.Cls", or simply "T" if the type parameter does not have any bounds).
- Throws:
IllegalArgumentException
- if a type parameter with the same name as the type variable could not be found in the defining method or the enclosing class.
-
hashCode
public int hashCode() -
equals
-
equalsIgnoringTypeParams
Description copied from class:TypeSignature
Compare base types, ignoring generic type parameters.- Specified by:
equalsIgnoringTypeParams
in classTypeSignature
- Parameters:
other
- the otherTypeSignature
to compare to.- Returns:
- True if the two
TypeSignature
objects are equal, ignoring type parameters.
-
toStringWithTypeBound
Returns the type variable along with its type bound, if available (e.g. "X extends xyz.Cls"). You can get this in structured form by callingresolve()
. Returns just the type variable if there is no type bound, or if no type bound is known (i.e. ifresolve()
returns null).- Returns:
- The string representation.
-
toStringWithSimpleNames
Render to string, using only simple names for classes.- Returns:
- the string representation, using simple names for classes.
-
toString
Render to string.
-