Class DefaultTypeName.Builder

java.lang.Object
io.helidon.common.types.DefaultTypeName.Builder
All Implemented Interfaces:
Builder<DefaultTypeName.Builder,DefaultTypeName>, Supplier<DefaultTypeName>
Enclosing class:
DefaultTypeName

public static class DefaultTypeName.Builder extends Object implements Builder<DefaultTypeName.Builder,DefaultTypeName>
The fluent builder.
  • Constructor Details

    • Builder

      protected Builder()
      Default ctor.
    • Builder

      protected Builder(TypeName val)
      Ctor taking the typeName for initialization.
      Parameters:
      val - the typeName
  • Method Details

    • build

      public DefaultTypeName build()
      Builds the instance.
      Specified by:
      build in interface Builder<DefaultTypeName.Builder,DefaultTypeName>
      Returns:
      the built instance
    • copyFrom

      protected DefaultTypeName.Builder copyFrom(TypeName val)
      Copy from an existing typeName.
      Parameters:
      val - the typeName to copy
      Returns:
      the fluent builder
    • packageName

      public DefaultTypeName.Builder packageName(String val)
      Set the package name.
      Parameters:
      val - the package name
      Returns:
      this fluent builder
    • className

      public DefaultTypeName.Builder className(String val)
      Set the simple class name.
      Parameters:
      val - the simple class name
      Returns:
      the fluent builder
    • type

      public DefaultTypeName.Builder type(Class<?> classType)
      Sets the package and class name, as well as whether it is primitive or an array.
      Parameters:
      classType - the class
      Returns:
      the fluent builder
    • array

      public DefaultTypeName.Builder array(boolean val)
      Sets the array flag for this type.
      Parameters:
      val - the array flag value
      Returns:
      the fluent builder
    • primitive

      public DefaultTypeName.Builder primitive(boolean val)
      Sets the primitive flag for this type.
      Parameters:
      val - the primitive flag value
      Returns:
      the fluent builder
    • generic

      public DefaultTypeName.Builder generic(boolean val)
      Sets the generic flag for this type.
      Parameters:
      val - the generic flag value
      Returns:
      the fluent builder
    • wildcard

      public DefaultTypeName.Builder wildcard(boolean val)
      Sets the wildcard flag for this type, and conditionally the generic flag if the value passed is true.
      Parameters:
      val - the array flag value
      Returns:
      the fluent builder
    • typeArguments

      public DefaultTypeName.Builder typeArguments(Collection<TypeName> val)
      Sets the generic type arguments to the collection passed, and if not empty will set the generic flag to true.
      Parameters:
      val - the generic type arguments
      Returns:
      the fluent builder