Interface TypeDetails

All Superinterfaces:
TypeVariableScope
All Known Subinterfaces:
ArrayTypeDetails, ClassBasedTypeDetails, ClassTypeDetails, ParameterizedTypeDetails, PrimitiveTypeDetails, TypeVariableDetails, TypeVariableReferenceDetails, VoidTypeDetails, WildcardTypeDetails
All Known Implementing Classes:
ArrayTypeDetailsImpl, ClassTypeDetailsImpl, ParameterizedTypeDetailsImpl, PrimitiveTypeDetailsImpl, TypeVariableDetailsImpl, TypeVariableReferenceDetailsImpl, VoidTypeDetailsImpl, WildcardTypeDetailsImpl

public interface TypeDetails extends TypeVariableScope
Abstraction for what Hibernate understands about a "type", generally before it has access to the actual Type reference.
  • Method Details

    • getName

      String getName()
    • getTypeKind

      TypeDetails.Kind getTypeKind()
    • isImplementor

      boolean isImplementor(Class<?> checkType)
      Whether the described class is an implementor of the given checkType.
    • asClassType

      default ClassTypeDetails asClassType()
      Cast this TypeDetails as a ClassTypeDetails, throwing an exception if it cannot be.
    • asPrimitiveType

      default PrimitiveTypeDetails asPrimitiveType()
      Cast this TypeDetails as a PrimitiveTypeDetails, throwing an exception if it cannot be.
    • asVoidType

      default VoidTypeDetails asVoidType()
      Cast this TypeDetails as a VoidTypeDetails, throwing an exception if it cannot be.
    • asArrayType

      default ArrayTypeDetails asArrayType()
      Cast this TypeDetails as a ArrayTypeDetails, throwing an exception if it cannot be.
    • asTypeVariable

      default TypeVariableDetails asTypeVariable()
      Cast this TypeDetails as a TypeVariableDetails, throwing an exception if it cannot be.
    • asParameterizedType

      default ParameterizedTypeDetails asParameterizedType()
      Cast this TypeDetails as a ParameterizedTypeDetails, throwing an exception if it cannot be.
    • asTypeVariableReference

      default TypeVariableReferenceDetails asTypeVariableReference()
      Cast this TypeDetails as a TypeVariableReferenceDetails, throwing an exception if it cannot be.
    • asWildcardType

      default WildcardTypeDetails asWildcardType()
      Cast this TypeDetails as a WildcardTypeDetails, throwing an exception if it cannot be.
    • isResolved

      default boolean isResolved()
      Determine whether all the bounds (if any) of the type are concretely known

      For example, given:

       class Thing<T> {
           T id;
       }
       class AnotherThing extends Thing<Integer> {
       }
       
      The type for id relative to Thing is NOT resolved whereas the type for id relative to AnotherThing is.
    • determineRelativeType

      default TypeDetails determineRelativeType(TypeVariableScope container)
      Determine the type relative to the passed container.

      For example, given the classes defined in isResolved(), calling this method has the following outcomes based on the passed container -

      • Passing Thing, the result would be the ParameterizedTypeDetails(T)
      • Passing AnotherThing, the result would be ClassTypeDetails(Integer)
    • determineRawClass

      default ClassDetails determineRawClass()
      Description copied from interface: TypeVariableScope
      Determine the raw class for the given type. Never returns null, opting to return Object instead if the raw class is not known
      Specified by:
      determineRawClass in interface TypeVariableScope
      Returns:
      The raw class details, or Object if "not known".