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`

public abstract class AbstractTypeReference extends Object implements TypeReference
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

Constructors
Modifier
Constructor
Description
`protected`
`AbstractTypeReference(String packageName, String simpleName, TypeReference enclosingType)`

## Method Summary

Modifier and Type
Method
Description
`protected String`
`addPackageIfNecessary(String part)`
`int`
`compareTo(TypeReference other)`
`boolean`
`equals(Object other)`
`TypeReference`
`getEnclosingType()`
Return the enclosing type reference, or `null` if this type reference does not have an enclosing type.
`String`
`getName()`
Return the fully qualified name of this type reference.
`String`
`getPackageName()`
Return the package name of this type.
`String`
`getSimpleName()`
Return the simple name of this type reference.
`int`
`hashCode()`
`protected abstract boolean`
`isPrimitive()`
`String`
`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

public String getName()
Description copied from interface: `TypeReference`
Return the fully qualified name of this type reference.

Specified by:
  `getName` in interface `TypeReference`
Returns:
  the reflection target name

### getPackageName

public String getPackageName()
Description copied from interface: `TypeReference`
Return the package name of this type.

Specified by:
  `getPackageName` in interface `TypeReference`
Returns:
  the package name

### getSimpleName

public String getSimpleName()
Description copied from interface: `TypeReference`
Return the simple name of this type reference.

Specified by:
  `getSimpleName` in interface `TypeReference`
Returns:
  the simple name

### getEnclosingType

@Nullable public TypeReference getEnclosingType()
Description copied from interface: `TypeReference`
Return the enclosing type reference, or `null` if this type reference does not have an enclosing type.

Specified by:
  `getEnclosingType` in interface `TypeReference`
Returns:
  the enclosing type, if any

### addPackageIfNecessary

protected String addPackageIfNecessary(String part)

### isPrimitive

protected abstract boolean isPrimitive()

### compareTo

public int compareTo(TypeReference other)

Specified by:
  `compareTo` in interface `Comparable<TypeReference>`

### equals

public boolean equals(@Nullable Object other)

Overrides:
  `equals` in class `Object`

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`

### toString

public String toString()

Overrides:
  `toString` in class `Object`