Class TypeVariable.Builder

Enclosing class:
TypeVariable

public static final class TypeVariable.Builder extends Type.Builder<TypeVariable.Builder>
Convenient builder for TypeVariable. If no bound is added, the built type variable will have a single bound of java.lang.Object.
Since:
3.1.0
  • Field Details

    • identifier

      private final String identifier
    • bounds

      private final List<Type> bounds
  • Constructor Details

    • Builder

      Builder(String identifier)
  • Method Details

    • addBound

      public TypeVariable.Builder addBound(Type bound)
      Adds a bound.
      Parameters:
      bound - the bound, must not be null
      Returns:
      this builder
    • addBound

      public TypeVariable.Builder addBound(Class<?> clazz)
      Adds a bound.
      Parameters:
      clazz - the class whose type is added as a bound, must not be null
      Returns:
      this builder
    • build

      public TypeVariable build()
      Returns the built type variable.
      Returns:
      the built type variable