/** * Creates an unbounded wildcard. Such a wildcard is implicitly bound above by the {@link Object} type. * * @param annotationSource The annotation source to query for the declared annotations. * @return A description of an unbounded wildcard. */ public static Generic unbounded(AnnotationSource annotationSource) { return new Latent(Collections.singletonList(TypeDescription.Generic.OBJECT), Collections.<Generic>emptyList(), annotationSource); }
/** * Creates a wildcard with a lower bound. Such a wildcard is implicitly bounded above by the {@link Object} type. * * @param lowerBound The lower bound of the wildcard. * @param annotationSource The annotation source to query for the declared annotations. * @return A wildcard with the given lower bound. */ public static Generic boundedBelow(Generic lowerBound, AnnotationSource annotationSource) { return new Latent(Collections.singletonList(TypeDescription.Generic.OBJECT), Collections.singletonList(lowerBound), annotationSource); }
/** * Creates a wildcard with an upper bound. * * @param upperBound The upper bound of the wildcard. * @param annotationSource The annotation source to query for the declared annotations. * @return A wildcard with the given upper bound. */ public static Generic boundedAbove(Generic upperBound, AnnotationSource annotationSource) { return new Latent(Collections.singletonList(upperBound), Collections.<Generic>emptyList(), annotationSource); }
/** * {@inheritDoc} */ public Generic onWildcard(Generic wildcard) { return new OfWildcardType.Latent(wildcard.getUpperBounds().accept(this), wildcard.getLowerBounds().accept(this), Empty.INSTANCE); }
/** * {@inheritDoc} */ public Generic onWildcard(Generic wildcard) { return new OfWildcardType.Latent(wildcard.getUpperBounds().accept(this), wildcard.getLowerBounds().accept(this), wildcard); }