Record Class PrimitiveTypeDetailsImpl

java.lang.Object
java.lang.Record
org.hibernate.models.internal.PrimitiveTypeDetailsImpl
All Implemented Interfaces:
ClassBasedTypeDetails, PrimitiveTypeDetails, TypeDetails, TypeVariableScope

public record PrimitiveTypeDetailsImpl(ClassDetails classDetails) extends Record implements PrimitiveTypeDetails
  • Constructor Details

    • PrimitiveTypeDetailsImpl

      public PrimitiveTypeDetailsImpl(ClassDetails classDetails)
      Creates an instance of a PrimitiveTypeDetailsImpl record class.
      Parameters:
      classDetails - the value for the classDetails record component
  • Method Details

    • getTypeKind

      public TypeDetails.Kind getTypeKind()
      Specified by:
      getTypeKind in interface PrimitiveTypeDetails
      Specified by:
      getTypeKind in interface TypeDetails
    • getPrimitiveKind

      public PrimitiveKind getPrimitiveKind()
      Specified by:
      getPrimitiveKind in interface PrimitiveTypeDetails
    • asPrimitiveType

      public PrimitiveTypeDetails asPrimitiveType()
      Description copied from interface: TypeDetails
      Cast this TypeDetails as a PrimitiveTypeDetails, throwing an exception if it cannot be.
      Specified by:
      asPrimitiveType in interface PrimitiveTypeDetails
      Specified by:
      asPrimitiveType in interface TypeDetails
    • resolveTypeVariable

      public TypeDetails resolveTypeVariable(TypeVariableDetails typeVariable)
      Description copied from interface: TypeVariableScope
      Resolve the type of the provided type variable relative to this scope.

      For example, given

       class Thing<I extends Number> {
           I id;
       }
       
      A call to this method on the Thing scope with the type variable representing I will return the I extends Number type variable definition itself.

      If this scope defines a corresponding type argument, the concrete type is returned. For example, given

       class Stuff extends Thing<Integer> {
       }
       
      This method will yield the Integer type details.
      Specified by:
      resolveTypeVariable in interface TypeVariableScope
      Parameters:
      typeVariable - The type variable to resolve
      Returns:
      The type variable's resolved type, or null if none could be found
    • getClassDetails

      public ClassDetails getClassDetails()
      Specified by:
      getClassDetails in interface ClassBasedTypeDetails
      Specified by:
      getClassDetails in interface PrimitiveTypeDetails
    • toCode

      public char toCode()
      Specified by:
      toCode in interface PrimitiveTypeDetails
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • classDetails

      public ClassDetails classDetails()
      Returns the value of the classDetails record component.
      Returns:
      the value of the classDetails record component