Package io.github.classgraph
Class BaseTypeSignature
- java.lang.Object
-
- io.github.classgraph.HierarchicalTypeSignature
-
- io.github.classgraph.TypeSignature
-
- io.github.classgraph.BaseTypeSignature
-
public class BaseTypeSignature extends TypeSignature
A type signature for a base type (byte, char, double, float, int, long, short, boolean, or void).
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Class<?>
classRef
The class ref, once the class is loaded.protected ScanResult
scanResult
The scan result.
-
Method Summary
All Methods Static 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 void
findReferencedClassNames(java.util.Set<java.lang.String> refdClassNames)
Get the names of any classes referenced in the type signature.protected ClassInfo
getClassInfo()
protected java.lang.String
getClassName()
The name of the class (used bygetClassInfo()
to fetch theClassInfo
object for the class).java.lang.Class<?>
getType()
Get the type.static BaseTypeSignature
getTypeSignature(java.lang.String typeName)
Get theBaseTypeSignature
for a given type name.java.lang.String
getTypeSignatureChar()
Get the type signature char used to represent the type, e.g.java.lang.String
getTypeStr()
Get the type as a string.int
hashCode()
protected java.lang.String
toStringInternal(boolean useSimpleNames)
TypeSignature.toString()
method, possibly returning simple names for classes (i.e.-
Methods inherited from class io.github.classgraph.TypeSignature
findReferencedClassInfo, toString, toStringWithSimpleNames
-
-
-
-
Field Detail
-
scanResult
protected transient ScanResult scanResult
The scan result.
-
classRef
protected transient java.lang.Class<?> classRef
The class ref, once the class is loaded.
-
-
Method Detail
-
getTypeStr
public java.lang.String getTypeStr()
Get the type as a string.- Returns:
- The base type, such as "int", "float", or "void".
-
getTypeSignatureChar
public java.lang.String getTypeSignatureChar()
Get the type signature char used to represent the type, e.g. "Z" for int.- Returns:
- the type signature char, as a one-char String.
-
getType
public java.lang.Class<?> getType()
Get the type.- Returns:
- The class of the base type, such as int.class, float.class, or void.class.
-
getTypeSignature
public static BaseTypeSignature getTypeSignature(java.lang.String typeName)
Get theBaseTypeSignature
for a given type name.- Parameters:
typeName
- the name of the type.- Returns:
- The
BaseTypeSignature
of the named base type, or null if typeName is not a base type.
-
getClassName
protected java.lang.String getClassName()
The name of the class (used bygetClassInfo()
to fetch theClassInfo
object for the class).- Returns:
- The class name.
-
getClassInfo
protected ClassInfo getClassInfo()
-
findReferencedClassNames
protected void findReferencedClassNames(java.util.Set<java.lang.String> refdClassNames)
Get the names of any classes referenced in the type signature.- Overrides:
findReferencedClassNames
in classTypeSignature
- Parameters:
refdClassNames
- the referenced class names.
-
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.
-
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.
-
-