Package org.springframework.aot.hint
Class AbstractTypeReference
java.lang.Object
org.springframework.aot.hint.AbstractTypeReference
- All Implemented Interfaces:
Comparable<TypeReference>,TypeReference
- Direct Known Subclasses:
GeneratedTypeReference
Base
TypeReference implementation that ensures consistent behaviour
for equals(), hashCode(), and toString() based on
the canonical name.- Since:
- 6.0
- Author:
- Stephane Nicoll
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractTypeReference(String packageName, String simpleName, TypeReference enclosingType) -
Method Summary
Modifier and TypeMethodDescriptionprotected StringaddPackageIfNecessary(String part) intcompareTo(TypeReference other) booleanReturn the enclosing type reference, ornullif this type reference does not have an enclosing type.getName()Return the fully qualified name of this type reference.Return the package name of this type.Return the simple name of this type reference.inthashCode()protected abstract booleantoString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.aot.hint.TypeReference
getCanonicalName
-
Constructor Details
-
AbstractTypeReference
protected AbstractTypeReference(String packageName, String simpleName, @Nullable TypeReference enclosingType)
-
-
Method Details
-
getName
Description copied from interface:TypeReferenceReturn the fully qualified name of this type reference.- Specified by:
getNamein interfaceTypeReference- Returns:
- the reflection target name
-
getPackageName
Description copied from interface:TypeReferenceReturn the package name of this type.- Specified by:
getPackageNamein interfaceTypeReference- Returns:
- the package name
-
getSimpleName
Description copied from interface:TypeReferenceReturn the simple name of this type reference.- Specified by:
getSimpleNamein interfaceTypeReference- Returns:
- the simple name
-
getEnclosingType
Description copied from interface:TypeReferenceReturn the enclosing type reference, ornullif this type reference does not have an enclosing type.- Specified by:
getEnclosingTypein interfaceTypeReference- Returns:
- the enclosing type, if any
-
addPackageIfNecessary
-
isPrimitive
protected abstract boolean isPrimitive() -
compareTo
- Specified by:
compareToin interfaceComparable<TypeReference>
-
equals
-
hashCode
public int hashCode() -
toString
-