Interface OptionBuilder

All Superinterfaces:
Prototype.Api
All Known Implementing Classes:
OptionBuilder.BuilderBase.OptionBuilderImpl

public interface OptionBuilder extends Prototype.Api
If an option itself has a builder, we add a method with Consumer<Builder>.

The type must have a builder method that returns a builder type. The builder then must have a build method that returns the option type, or a buildPrototype method.

See Also:
  • Method Details

    • builder

      static OptionBuilder.Builder builder()
      Create a new fluent API builder to customize configuration.
      Returns:
      a new builder
    • builder

      static OptionBuilder.Builder builder(OptionBuilder instance)
      Create a new fluent API builder from an existing instance.
      Parameters:
      instance - an existing instance used as a base for the builder
      Returns:
      a builder based on an instance
    • builderMethodName

      String builderMethodName()
      Name of the static builder method, or <init> to identify a constructor should be used. If a method name is defined, it is expected to be on the type of the option. If constructor is defined, it is expected to be an accessible constructor on the builderType().
      Returns:
      name of the method
    • builderType

      TypeName builderType()
      Type of the builder.
      Returns:
      type of the builder
    • builderMethodType

      TypeName builderMethodType()
      Type of the class declaring a builderMethodName() used to get an instance of the builder to send to the generated setter with consumer.
      Returns:
      type declaring the builder method
    • buildMethodName

      String buildMethodName()
      Name of the build method (build or buildPrototype).
      Returns:
      builder build method name