Signature.TypeArg (Java SE 23 & JDK 23)
Description: declaration: module: java.base, package: java.lang.classfile, interface: Signature, interface: TypeArg
Keywords: java.lang.classfile.Signature.TypeArg interface

# Interface Signature.TypeArg

All Known Subinterfaces:
  `Signature.TypeArg.BoundedPREVIEW`, `Signature.TypeArg.UnboundedPREVIEW`

Enclosing interface:
  `SignaturePREVIEW`

public static sealed interface Signature.TypeArg permits Signature.TypeArg.UnboundedPREVIEW, Signature.TypeArg.BoundedPREVIEW
`TypeArg` is a preview API of the Java platform.
Programs can only use `TypeArg` when preview features are enabled.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
Models the type argument.

Since:
  22

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Interface
  Description
  `static interface`
  `Signature.TypeArg.BoundedPREVIEW`
  Preview.
  Models a type argument with an explicit bound type.
  `static interface`
  `Signature.TypeArg.UnboundedPREVIEW`
  Preview.
  Models an unbounded type argument `*`.

- ## Method Summary

  Static Methods
  Modifier and Type
  Method
  Description
  `static Signature.TypeArg.BoundedPREVIEW`
  `bounded(Signature.TypeArg.Bounded.WildcardIndicatorPREVIEW wildcard, Signature.RefTypeSigPREVIEW boundType)`
  Returns a bounded type arg.
  `static Signature.TypeArg.BoundedPREVIEW`
  `extendsOf(Signature.RefTypeSigPREVIEW boundType)`
  Returns an upper-bounded type arg.
  `static Signature.TypeArg.BoundedPREVIEW`
  `of(Signature.RefTypeSigPREVIEW boundType)`
  Returns a bounded type arg.
  `static Signature.TypeArg.BoundedPREVIEW`
  `superOf(Signature.RefTypeSigPREVIEW boundType)`
  Returns a lower-bounded type arg.
  `static Signature.TypeArg.UnboundedPREVIEW`
  `unbounded()`
  Returns an unbounded type arg.

- ## Method Details

  - ### of

    static Signature.TypeArg.BoundedPREVIEW of(Signature.RefTypeSigPREVIEW boundType)
    Returns a bounded type arg.
    Parameters:
      `boundType` - the bound
    Returns:
      a bounded type arg
    Since:
      23

  - ### unbounded

    static Signature.TypeArg.UnboundedPREVIEW unbounded()
    Returns an unbounded type arg.
    Returns:
      an unbounded type arg
    Since:
      23

  - ### extendsOf

    static Signature.TypeArg.BoundedPREVIEW extendsOf(Signature.RefTypeSigPREVIEW boundType)
    Returns an upper-bounded type arg.
    Parameters:
      `boundType` - the upper bound
    Returns:
      an upper-bounded type arg
    Since:
      23

  - ### superOf

    static Signature.TypeArg.BoundedPREVIEW superOf(Signature.RefTypeSigPREVIEW boundType)
    Returns a lower-bounded type arg.
    Parameters:
      `boundType` - the lower bound
    Returns:
      a lower-bounded type arg
    Since:
      23

  - ### bounded

    static Signature.TypeArg.BoundedPREVIEW bounded(Signature.TypeArg.Bounded.WildcardIndicatorPREVIEW wildcard, Signature.RefTypeSigPREVIEW boundType)
    Returns a bounded type arg.
    Parameters:
      `wildcard` - the wild card
      `boundType` - optional bound type
    Returns:
      a bounded type arg
    Since:
      23