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
ConstructorsModifierConstructorDescriptionprotected
AbstractTypeReference
(String packageName, String simpleName, TypeReference enclosingType) -
Method Summary
Modifier and TypeMethodDescriptionprotected String
addPackageIfNecessary
(String part) int
compareTo
(TypeReference other) boolean
Return the enclosing type reference, ornull
if 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.int
hashCode()
protected abstract boolean
toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods 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:TypeReference
Return the fully qualified name of this type reference.- Specified by:
getName
in interfaceTypeReference
- Returns:
- the reflection target name
-
getPackageName
Description copied from interface:TypeReference
Return the package name of this type.- Specified by:
getPackageName
in interfaceTypeReference
- Returns:
- the package name
-
getSimpleName
Description copied from interface:TypeReference
Return the simple name of this type reference.- Specified by:
getSimpleName
in interfaceTypeReference
- Returns:
- the simple name
-
getEnclosingType
Description copied from interface:TypeReference
Return the enclosing type reference, ornull
if this type reference does not have an enclosing type.- Specified by:
getEnclosingType
in interfaceTypeReference
- Returns:
- the enclosing type, if any
-
addPackageIfNecessary
-
isPrimitive
protected abstract boolean isPrimitive() -
compareTo
- Specified by:
compareTo
in interfaceComparable<TypeReference>
-
equals
-
hashCode
public int hashCode() -
toString
-