Class TypeArgument

java.lang.Object
io.quarkus.gizmo2.TypeArgument
Direct Known Subclasses:
TypeArgument.OfExact, TypeArgument.OfWildcard

public abstract sealed class TypeArgument extends Object permits TypeArgument.OfExact, TypeArgument.OfWildcard
An actual type argument for a formal type parameter. Type arguments differ from generic types in that they may represent wildcard types.
  • Method Details

    • of

      public static TypeArgument.OfExact of(Class<?> type)
      Returns a type argument representing exactly the given type.
      Parameters:
      type - the argument type (must not be null)
      Returns:
      a type argument representing exactly the given type
    • of

      public static TypeArgument.OfExact of(ClassDesc type)
      Returns a type argument representing exactly the given type.
      Parameters:
      type - the argument type (must not be null)
      Returns:
      a type argument representing exactly the given type
    • ofExact

      public static TypeArgument.OfExact ofExact(GenericType.OfReference type)
      Returns a type argument representing exactly the given type.
      Parameters:
      type - the argument type (must not be null)
      Returns:
      a type argument representing exactly the given type
    • ofExtends

      public static TypeArgument.OfExtends ofExtends(GenericType.OfReference bound)
      Returns a type argument representing a wildcard with given upper bound.
      Parameters:
      bound - the bound (must not be null)
      Returns:
      a type argument representing a wildcard with given upper bound
    • ofSuper

      public static TypeArgument.OfSuper ofSuper(GenericType.OfReference bound)
      Returns a type argument representing a wildcard with given lower bound.
      Parameters:
      bound - the bound (must not be null)
      Returns:
      a type argument representing a wildcard with given lower bound
    • ofUnbounded

      public static TypeArgument.OfUnbounded ofUnbounded()
      Returns a type argument representing the unbounded wildcard.
      Returns:
      a type argument representing the unbounded wildcard
    • hasVisibleAnnotations

      public abstract boolean hasVisibleAnnotations()
      Returns true if runtime-visible type annotations are present, or false otherwise.
      Returns:
      true if runtime-visible type annotations are present, or false otherwise
    • hasInvisibleAnnotations

      public abstract boolean hasInvisibleAnnotations()
      Returns true if runtime-invisible type annotations are present, or false otherwise.
      Returns:
      true if runtime-invisible type annotations are present, or false otherwise
    • hasAnnotations

      public final boolean hasAnnotations()
      Returns true if any type annotations are present, or false otherwise.
      Returns:
      true if any type annotations are present, or false otherwise
    • toString

      public abstract StringBuilder toString(StringBuilder b)
      Append the string representation of this type argument to the given builder, and return it.
      Parameters:
      b - the string builder (must not be null)
      Returns:
      the same string builder (not null)
    • toString

      public String toString()
      Returns the string representation of this type argument.
      Overrides:
      toString in class Object
      Returns:
      the string representation of this type argument