Class WildcardType.Builder

java.lang.Object
org.jboss.jandex.WildcardType.Builder
Enclosing class:
WildcardType

public static final class WildcardType.Builder extends Object
Convenient builder for WildcardType.

Note that only one bound may be set. If the setUpperBound() and setLowerBound() methods are called multiple times, only the last call is taken into account; the previously set bounds are ignored.

Since:
3.1.0
  • Field Details

  • Method Details

    • setUpperBound

      public WildcardType.Builder setUpperBound(Class<?> upperBound)
      Sets the upper bound.
      Parameters:
      upperBound - the class whose type is set as the upper bound, must not be null
      Returns:
      this builder
    • setUpperBound

      public WildcardType.Builder setUpperBound(Type upperBound)
      Sets the upper bound.
      Parameters:
      upperBound - the upper bound, must not be null
      Returns:
      this builder
    • setLowerBound

      public WildcardType.Builder setLowerBound(Class<?> lowerBound)
      Sets the lower bound.
      Parameters:
      lowerBound - the class whose type is set as the lower bound, must not be null
      Returns:
      this builder
    • setLowerBound

      public WildcardType.Builder setLowerBound(Type lowerBound)
      Sets the lower bound.
      Parameters:
      lowerBound - the lower bound, must not be null
      Returns:
      this builder
    • build

      public WildcardType build()
      Returns the built wildcard type.
      Returns:
      the built wildcard type
    • self

      protected WildcardType.Builder self()
    • annotationsArray

      protected AnnotationInstance[] annotationsArray()
      Returns:
      the annotations array or null if no annotation was specified
    • addAnnotation

      public WildcardType.Builder addAnnotation(AnnotationInstance annotation)
      Adds an annotation to the type being created by this builder. Note that it becomes a type annotation.
      Parameters:
      annotation - the annotation instance; can be created using AnnotationInstance.builder()
      Returns:
      this builder
      See Also: