Interface ParameterizedType

All Superinterfaces:
AnnotationTarget, Type

public interface ParameterizedType extends Type
A parameterized type. That is, a generic class together with a list of type arguments. The list of type arguments has the same shape as the class's list of type parameters.
Since:
4.0
  • Method Details

    • genericClass

      ClassType genericClass()
      Returns the type of the generic class that was parameterized with a list of type arguments to form this parameterized type.
      Returns:
      the type of the generic class, never null
    • typeArguments

      List<Type> typeArguments()
      Returns the list of type arguments that were applied to a generic class to form this parameterized type.
      Returns:
      immutable list of type arguments, never null or empty
    • declaration

      default ClassInfo declaration()
      Returns the declaration of the generic class that was parameterized with a list of type arguments to form this parameterized type.
      Returns:
      the declaration of the generic class, never null
    • kind

      default Type.Kind kind()
      Description copied from interface: Type
      Returns the kind of this type.
      Specified by:
      kind in interface Type
      Returns:
      the kind of this type
    • asParameterizedType

      default ParameterizedType asParameterizedType()
      Description copied from interface: Type
      Returns this type as a parameterized type.
      Specified by:
      asParameterizedType in interface Type
      Returns:
      this parameterized type, never null