Class WildcardType.Builder

  • Enclosing class:
    WildcardType

    public static final class WildcardType.Builder
    extends Type.Builder<WildcardType.Builder>
    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 Detail

      • isExtends

        private boolean isExtends
      • bound

        private Type bound
    • Constructor Detail

      • Builder

        Builder()
    • Method Detail

      • setUpperBound

        public WildcardType.Builder setUpperBound​(java.lang.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​(java.lang.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