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
-
public final class TypeVariableSignature extends ClassRefOrTypeVariableSignature
A type variable signature.
-
-
Field Summary
Fields Modifier and Type Field Description protected ScanResult
scanResult
The scan result.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
boolean
equalsIgnoringTypeParams(TypeSignature other)
Compare base types, ignoring generic type parameters.protected java.lang.String
getClassName()
Return definingClassName, so that getClassInfo() returns theClassInfo
object for the containing class.java.lang.String
getName()
Get the name of the type variable.int
hashCode()
TypeParameter
resolve()
Look up a type variable (e.g.protected java.lang.String
toStringInternal(boolean useSimpleNames)
TypeSignature.toString()
method, possibly returning simple names for classes (i.e.java.lang.String
toStringWithTypeBound()
Returns the type variable along with its type bound, if available (e.g.-
Methods inherited from class io.github.classgraph.TypeSignature
toString, toStringWithSimpleNames
-
-
-
-
Field Detail
-
scanResult
protected transient ScanResult scanResult
The scan result.
-
-
Method Detail
-
getName
public java.lang.String getName()
Get the name of the type variable.- Returns:
- The type variable name.
-
resolve
public TypeParameter 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:
java.lang.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.
-
getClassName
protected java.lang.String getClassName()
Return definingClassName, so that getClassInfo() returns theClassInfo
object for the containing class.- Returns:
- the defining class name.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
equalsIgnoringTypeParams
public boolean equalsIgnoringTypeParams(TypeSignature other)
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
public java.lang.String 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.
-
toStringInternal
protected java.lang.String toStringInternal(boolean useSimpleNames)
Description copied from class:TypeSignature
TypeSignature.toString()
method, possibly returning simple names for classes (i.e. if useSimpleNames is true, the package names of classes are stripped).- Specified by:
toStringInternal
in classTypeSignature
- Parameters:
useSimpleNames
- whether or not to use simple names for classes.- Returns:
- the string representation of the type signature, with package names stripped.
-
-