Class ClassRefTypeSignature
- java.lang.Object
-
- io.github.lukehutch.fastclasspathscanner.typesignature.HierarchicalTypeSignature
-
- io.github.lukehutch.fastclasspathscanner.typesignature.TypeSignature
-
- io.github.lukehutch.fastclasspathscanner.typesignature.ReferenceTypeSignature
-
- io.github.lukehutch.fastclasspathscanner.typesignature.ClassRefOrTypeVariableSignature
-
- io.github.lukehutch.fastclasspathscanner.typesignature.ClassRefTypeSignature
-
public class ClassRefTypeSignature extends ClassRefOrTypeVariableSignature
A class reference type signature (called "ClassTypeSignature" in the classfile documentation).
-
-
Constructor Summary
Constructors Constructor Description ClassRefTypeSignature(String className, List<TypeArgument> typeArguments, List<String> suffixes, List<List<TypeArgument>> suffixTypeArguments)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)booleanequalsIgnoringTypeParams(TypeSignature other)Compare base types, ignoring generic type parameters.voidgetAllReferencedClassNames(Set<String> classNameListOut)Get the names of all classes referenced in the type signatureStringgetClassName()Get the name of the base class.StringgetClassNameAndSuffixesWithoutTypeArguments()Get the name of the class, along with any suffixes (suffixes are for inner class nesting, and are separated by '$').List<String>getSuffixes()Get any suffixes of the class (typically nested inner class names).List<List<TypeArgument>>getSuffixTypeArguments()Get any type arguments for any suffixes of the class, one list per suffix.List<TypeArgument>getTypeArguments()Get any type arguments of the base class.inthashCode()Class<?>instantiate(ScanResult scanResult)Instantiate class ref.StringtoString()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from class io.github.lukehutch.fastclasspathscanner.typesignature.TypeSignature
parse
-
-
-
-
Constructor Detail
-
ClassRefTypeSignature
public ClassRefTypeSignature(String className, List<TypeArgument> typeArguments, List<String> suffixes, List<List<TypeArgument>> suffixTypeArguments)
- Parameters:
className- The class name.typeArguments- The class type arguments.suffixes- The class suffixes (for inner classes)suffixTypeArguments- The suffix type arguments.
-
-
Method Detail
-
getClassName
public String getClassName()
Get the name of the base class.- Returns:
- The base class name.
-
getTypeArguments
public List<TypeArgument> getTypeArguments()
Get any type arguments of the base class.- Returns:
- The type arguments for the base class.
-
getSuffixes
public List<String> getSuffixes()
Get any suffixes of the class (typically nested inner class names).- Returns:
- The class suffixes (for inner classes).
-
getSuffixTypeArguments
public List<List<TypeArgument>> getSuffixTypeArguments()
Get any type arguments for any suffixes of the class, one list per suffix.- Returns:
- The type arguments for the inner classes, one list per suffix.
-
getAllReferencedClassNames
public void getAllReferencedClassNames(Set<String> classNameListOut)
Description copied from class:HierarchicalTypeSignatureGet the names of all classes referenced in the type signature- Specified by:
getAllReferencedClassNamesin classHierarchicalTypeSignature- Parameters:
classNameListOut- The set to store class names in.
-
instantiate
public Class<?> instantiate(ScanResult scanResult)
Instantiate class ref. Type arguments are ignored.- Specified by:
instantiatein classTypeSignature- Parameters:
scanResult- The scan result.- Returns:
- The instantiation of the type signature as a
Class<?>.
-
getClassNameAndSuffixesWithoutTypeArguments
public String getClassNameAndSuffixesWithoutTypeArguments()
Get the name of the class, along with any suffixes (suffixes are for inner class nesting, and are separated by '$'). The returned name is stripped of any type arguments, e.g."xyz.Cls<String>$InnerCls<Integer>"is returned as"xyz.Cls$InnerCls".- Returns:
- The name of the class and suffixes without type arguments.
-
equalsIgnoringTypeParams
public boolean equalsIgnoringTypeParams(TypeSignature other)
Description copied from class:TypeSignatureCompare base types, ignoring generic type parameters.- Specified by:
equalsIgnoringTypeParamsin classTypeSignature- Parameters:
other- the otherTypeSignatureto compare to.- Returns:
- True if the two
TypeSignatureobjects are equal, ignoring type parameters.
-
-