Class AbstractTypeReference

java.lang.Object
org.springframework.aot.hint.AbstractTypeReference
All Implemented Interfaces:
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 Details

  • 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
    • isPrimitive

      protected abstract boolean isPrimitive()
    • addPackageIfNecessary

      protected String addPackageIfNecessary(String part)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object