Class FactoryMethod.BuilderBase<BUILDER extends FactoryMethod.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends FactoryMethod>

java.lang.Object
io.helidon.builder.codegen.FactoryMethod.BuilderBase<BUILDER,PROTOTYPE>
Type Parameters:
BUILDER - type of the builder extending this abstract builder
PROTOTYPE - type of the prototype interface that would be built by Prototype.Builder.buildPrototype()
All Implemented Interfaces:
Prototype.Builder<BUILDER,PROTOTYPE>
Direct Known Subclasses:
FactoryMethod.Builder
Enclosing interface:
FactoryMethod

public abstract static class FactoryMethod.BuilderBase<BUILDER extends FactoryMethod.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends FactoryMethod> extends Object implements Prototype.Builder<BUILDER,PROTOTYPE>
Fluent API builder base for FactoryMethod.
  • Constructor Details

    • BuilderBase

      protected BuilderBase()
      Protected to support extensibility.
  • Method Details

    • from

      public BUILDER from(FactoryMethod prototype)
      Update this builder from an existing prototype instance. This method disables automatic service discovery.
      Parameters:
      prototype - existing prototype to update this builder from
      Returns:
      updated builder instance
    • from

      public BUILDER from(FactoryMethod.BuilderBase<?,?> builder)
      Update this builder from an existing prototype builder instance.
      Parameters:
      builder - existing builder prototype to update this builder from
      Returns:
      updated builder instance
    • declaringType

      public BUILDER declaringType(TypeName declaringType)
      Type declaring the factory method.
      Parameters:
      declaringType - type declaring the factory method
      Returns:
      updated builder instance
      See Also:
    • declaringType

      public BUILDER declaringType(Consumer<TypeName.Builder> consumer)
      Type declaring the factory method.
      Parameters:
      consumer - consumer of builder of type declaring the factory method
      Returns:
      updated builder instance
      See Also:
    • declaringType

      public BUILDER declaringType(Supplier<? extends TypeName> supplier)
      Type declaring the factory method.
      Parameters:
      supplier - supplier of type declaring the factory method
      Returns:
      updated builder instance
      See Also:
    • returnType

      public BUILDER returnType(TypeName returnType)
      Return type of the factory method.
      Parameters:
      returnType - return type of the factory method
      Returns:
      updated builder instance
      See Also:
    • returnType

      public BUILDER returnType(Consumer<TypeName.Builder> consumer)
      Return type of the factory method.
      Parameters:
      consumer - consumer of builder of return type of the factory method
      Returns:
      updated builder instance
      See Also:
    • returnType

      public BUILDER returnType(Supplier<? extends TypeName> supplier)
      Return type of the factory method.
      Parameters:
      supplier - supplier of return type of the factory method
      Returns:
      updated builder instance
      See Also:
    • methodName

      public BUILDER methodName(String methodName)
      Name of the factory method.
      Parameters:
      methodName - factory method name
      Returns:
      updated builder instance
      See Also:
    • clearParameterType

      public BUILDER clearParameterType()
      Clear existing value of parameterType.
      Returns:
      updated builder instance
      See Also:
    • parameterType

      public BUILDER parameterType(TypeName parameterType)
      A parameter of the factory method, if any.
      Parameters:
      parameterType - parameter type, if any
      Returns:
      updated builder instance
      See Also:
    • parameterType

      public BUILDER parameterType(Consumer<TypeName.Builder> consumer)
      A parameter of the factory method, if any.
      Parameters:
      consumer - consumer of builder of parameter type, if any
      Returns:
      updated builder instance
      See Also:
    • parameterType

      public BUILDER parameterType(Supplier<? extends TypeName> supplier)
      A parameter of the factory method, if any.
      Parameters:
      supplier - supplier of parameter type, if any
      Returns:
      updated builder instance
      See Also:
    • clearOptionName

      public BUILDER clearOptionName()
      Clear existing value of optionName.
      Returns:
      updated builder instance
      See Also:
    • optionName

      public BUILDER optionName(String optionName)
      A factory method may be bound to a specific option.
      Parameters:
      optionName - name of the option this factory method is bound to, if any
      Returns:
      updated builder instance
      See Also:
    • declaringType

      public Optional<TypeName> declaringType()
      Type declaring the factory method.
      Returns:
      type declaring the factory method
    • returnType

      public Optional<TypeName> returnType()
      Return type of the factory method.
      Returns:
      return type of the factory method
    • methodName

      public Optional<String> methodName()
      Name of the factory method.
      Returns:
      factory method name
    • parameterType

      public Optional<TypeName> parameterType()
      A parameter of the factory method, if any.
      Returns:
      parameter type, if any
    • optionName

      public Optional<String> optionName()
      A factory method may be bound to a specific option.
      Returns:
      name of the option this factory method is bound to, if any
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • preBuildPrototype

      protected void preBuildPrototype()
      Handles providers and decorators.
    • validatePrototype

      protected void validatePrototype()
      Validates required properties.