Class TypeDescription.Generic.OfWildcardType.Latent

All Implemented Interfaces:
Iterable<TypeDefinition>, AnnotationSource, ModifierReviewable, ModifierReviewable.ForFieldDescription, ModifierReviewable.ForMethodDescription, ModifierReviewable.ForParameterDescription, ModifierReviewable.ForTypeDefinition, ModifierReviewable.OfAbstraction, ModifierReviewable.OfByteCodeElement, ModifierReviewable.OfEnumeration, NamedElement, TypeDefinition, TypeDescription.Generic
Enclosing class:
TypeDescription.Generic.OfWildcardType

public static class TypeDescription.Generic.OfWildcardType.Latent extends TypeDescription.Generic.OfWildcardType
A latent description of a wildcard type.
  • Field Details

  • Constructor Details

    • Latent

      protected Latent(List<? extends TypeDescription.Generic> upperBounds, List<? extends TypeDescription.Generic> lowerBounds, AnnotationSource annotationSource)
      Creates a description of a latent wildcard.
      Parameters:
      upperBounds - The wildcard's upper bounds.
      lowerBounds - The wildcard's lower bounds.
      annotationSource - The annotation source to query for the declared annotations.
  • Method Details

    • unbounded

      public static TypeDescription.Generic unbounded(AnnotationSource annotationSource)
      Creates an unbounded wildcard. Such a wildcard is implicitly bound above by the Object type.
      Parameters:
      annotationSource - The annotation source to query for the declared annotations.
      Returns:
      A description of an unbounded wildcard.
    • boundedAbove

      public static TypeDescription.Generic boundedAbove(TypeDescription.Generic upperBound, AnnotationSource annotationSource)
      Creates a wildcard with an upper bound.
      Parameters:
      upperBound - The upper bound of the wildcard.
      annotationSource - The annotation source to query for the declared annotations.
      Returns:
      A wildcard with the given upper bound.
    • boundedBelow

      public static TypeDescription.Generic boundedBelow(TypeDescription.Generic lowerBound, AnnotationSource annotationSource)
      Creates a wildcard with a lower bound. Such a wildcard is implicitly bounded above by the Object type.
      Parameters:
      lowerBound - The lower bound of the wildcard.
      annotationSource - The annotation source to query for the declared annotations.
      Returns:
      A wildcard with the given lower bound.
    • getUpperBounds

      public TypeList.Generic getUpperBounds()

      Returns the upper bounds of this type. Any type with a well-defined upper bound is bound by at least one type. If no such type is defined, the bound is implicitly Object.

      Only non-symbolic type variables (TypeDefinition.Sort.VARIABLE, and wildcard types (TypeDefinition.Sort.WILDCARD) have well-defined upper bounds. For other types, an IllegalStateException is thrown.

      Returns:
      The upper bounds of this type.
    • getLowerBounds

      public TypeList.Generic getLowerBounds()

      Returns the lower bounds of this type.

      Only wildcard types (TypeDefinition.Sort.WILDCARD) define a lower bound. For other types, an IllegalStateException is thrown.

      Returns:
      The lower bounds of this type.
    • getDeclaredAnnotations

      public AnnotationList getDeclaredAnnotations()
      Returns a list of annotations that are declared by this instance.
      Returns:
      A list of declared annotations.