Class TypeDescription.Generic.OfWildcardType.Latent

    • Field Detail

      • upperBounds

        private final java.util.List<? extends TypeDescription.Generic> upperBounds
        The wildcard's upper bounds.
      • lowerBounds

        private final java.util.List<? extends TypeDescription.Generic> lowerBounds
        The wildcard's lower bounds.
      • annotationSource

        private final AnnotationSource annotationSource
        The annotation source to query for the declared annotations.
    • Constructor Detail

      • Latent

        protected Latent​(java.util.List<? extends TypeDescription.Generic> upperBounds,
                         java.util.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 Detail

      • 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.