Class TypeParameter

java.lang.Object
io.quarkus.gizmo2.TypeParameter
All Implemented Interfaces:
GenericTyped, SimpleTyped, Typed
Direct Known Subclasses:
TypeParameter.OfConstructor, TypeParameter.OfMethod, TypeParameter.OfType

public abstract sealed class TypeParameter extends Object implements GenericTyped permits TypeParameter.OfConstructor, TypeParameter.OfMethod, TypeParameter.OfType
A type parameter on a class, interface, or method. The difference between type parameters and type variables is that type parameters may declare bounds.
  • Method Details

    • firstBound

      public Optional<GenericType.OfThrows> firstBound()
      Returns the optional first (primary) bound (not null). This should be a class or type variable bound.
      Returns:
      the optional first (primary) bound (not null)
    • otherBounds

      public List<GenericType.OfThrows> otherBounds()
      Returns the other (secondary) bounds (not null). This should be a list of interface types, or empty if the first bound is a type variable.
      Returns:
      the other (secondary) bounds (not null)
    • name

      public String name()
      Returns the type variable name.
      Returns:
      the type variable name
    • genericType

      public GenericType.OfTypeVariable genericType()
      Returns the generic type corresponding to this type variable (not null).
      Specified by:
      genericType in interface GenericTyped
      Returns:
      the generic type corresponding to this type variable (not null)
    • hasGenericType

      public boolean hasGenericType()
      Description copied from interface: GenericTyped
      Returns true if this value has a generic type, or false if it does not have one.
      Specified by:
      hasGenericType in interface GenericTyped
      Returns:
      true if this value has a generic type, or false if it does not have one
    • type

      public ClassDesc type()
      Returns the type of this type variable, which is equal to its erasure (not null).
      Specified by:
      type in interface SimpleTyped
      Specified by:
      type in interface Typed
      Returns:
      the type of this type variable, which is equal to its erasure (not null)
    • visibleIn

      public abstract boolean visibleIn(ClassDesc desc)
      Returns true if this type variable is visible throughout the given class, or false if it is not.
      Returns:
      true if this type variable is visible throughout the given class, or false if it is not
    • visibleIn

      public abstract boolean visibleIn(MethodDesc desc)
      Returns true if this type variable is visible throughout the given method, or false if it is not.
      Returns:
      true if this type variable is visible throughout the given method, or false if it is not
    • visibleIn

      public abstract boolean visibleIn(ConstructorDesc desc)
      Returns true if this type variable is visible throughout the given constructor, or false if it is not.
      Returns:
      true if this type variable is visible throughout the given constructor, or false if it is not
    • equals

      public final boolean equals(Object obj)
      Returns true if this object is equal to the given object, or false if it is not.
      Overrides:
      equals in class Object
      Returns:
      true if this object is equal to the given object, or false if it is not
    • equals

      public boolean equals(TypeParameter other)
      Returns true if this object is equal to the given object, or false if it is not.
      Returns:
      true if this object is equal to the given object, or false if it is not
    • hashCode

      public int hashCode()
      Returns the hash code for this type variable.
      Overrides:
      hashCode in class Object
      Returns:
      the hash code for this type variable
    • toString

      public String toString()
      Returns the name of this type variable.
      Overrides:
      toString in class Object
      Returns:
      the name of this type variable
    • erasure

      public ClassDesc erasure()
      Returns the erased type of this type variable (not null).
      Returns:
      the erased type of this type variable (not null)