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

java.lang.Object
io.helidon.builder.codegen.OptionInfo.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:
OptionInfo.Builder
Enclosing interface:
OptionInfo

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

    • BuilderBase

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

    • from

      public BUILDER from(OptionInfo 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(OptionInfo.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
    • clearInterfaceMethod

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

      public BUILDER interfaceMethod(TypedElementInfo interfaceMethod)
      Blueprint method if created from blueprint, or interface method if inherited from non-blueprint interface. Empty in case this is a "synthetic" option.
      Parameters:
      interfaceMethod - interface method, if present
      Returns:
      updated builder instance
      See Also:
    • interfaceMethod

      public BUILDER interfaceMethod(Consumer<TypedElementInfo.Builder> consumer)
      Blueprint method if created from blueprint, or interface method if inherited from non-blueprint interface. Empty in case this is a "synthetic" option.
      Parameters:
      consumer - consumer of builder of interface method, if present
      Returns:
      updated builder instance
      See Also:
    • interfaceMethod

      public BUILDER interfaceMethod(Supplier<? extends TypedElementInfo> supplier)
      Blueprint method if created from blueprint, or interface method if inherited from non-blueprint interface. Empty in case this is a "synthetic" option.
      Parameters:
      supplier - supplier of interface method, if present
      Returns:
      updated builder instance
      See Also:
    • clearDeclaringType

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

      public BUILDER declaringType(TypeInfo declaringType)
      Type that declares this option. This may be the blueprint type, or an interface type. In case this is a "synthetic" option, there is not type to use.
      Parameters:
      declaringType - type that declares this option, if present
      Returns:
      updated builder instance
      See Also:
    • declaringType

      public BUILDER declaringType(Consumer<TypeInfo.Builder> consumer)
      Type that declares this option. This may be the blueprint type, or an interface type. In case this is a "synthetic" option, there is not type to use.
      Parameters:
      consumer - consumer of builder of type that declares this option, if present
      Returns:
      updated builder instance
      See Also:
    • declaringType

      public BUILDER declaringType(Supplier<? extends TypeInfo> supplier)
      Type that declares this option. This may be the blueprint type, or an interface type. In case this is a "synthetic" option, there is not type to use.
      Parameters:
      supplier - supplier of type that declares this option, if present
      Returns:
      updated builder instance
      See Also:
    • name

      public BUILDER name(String name)
      Option name.
      Parameters:
      name - name of this option
      Returns:
      updated builder instance
      See Also:
    • getterName

      public BUILDER getterName(String getterName)
      Name of the getter methods.
      Parameters:
      getterName - getter method name
      Returns:
      updated builder instance
      See Also:
    • setterName

      public BUILDER setterName(String setterName)
      Name of the setter method(s).
      Parameters:
      setterName - setter method name
      Returns:
      updated builder instance
      See Also:
    • declaredType

      public BUILDER declaredType(TypeName declaredType)
      The return type of the blueprint method, or the type expected in getter of the option.
      Parameters:
      declaredType - declared type
      Returns:
      updated builder instance
      See Also:
    • declaredType

      public BUILDER declaredType(Consumer<TypeName.Builder> consumer)
      The return type of the blueprint method, or the type expected in getter of the option.
      Parameters:
      consumer - consumer of builder of declared type
      Returns:
      updated builder instance
      See Also:
    • declaredType

      public BUILDER declaredType(Supplier<? extends TypeName> supplier)
      The return type of the blueprint method, or the type expected in getter of the option.
      Parameters:
      supplier - supplier of declared type
      Returns:
      updated builder instance
      See Also:
    • clearDecorator

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

      public BUILDER decorator(TypeName decorator)
      Option decorator type.
      Parameters:
      decorator - type of the option decorator, if present
      Returns:
      updated builder instance
      See Also:
    • decorator

      public BUILDER decorator(Consumer<TypeName.Builder> consumer)
      Option decorator type.
      Parameters:
      consumer - consumer of builder of type of the option decorator, if present
      Returns:
      updated builder instance
      See Also:
    • decorator

      public BUILDER decorator(Supplier<? extends TypeName> supplier)
      Option decorator type.
      Parameters:
      supplier - supplier of type of the option decorator, if present
      Returns:
      updated builder instance
      See Also:
    • includeInToString

      public BUILDER includeInToString(boolean includeInToString)
      Whether to include this option in generated Object.toString() method.
      Parameters:
      includeInToString - whether to include in the toString method
      Returns:
      updated builder instance
      See Also:
    • includeInEqualsAndHashCode

      public BUILDER includeInEqualsAndHashCode(boolean includeInEqualsAndHashCode)
      Whether to include this option in generated Object.equals(Object) and Object.hashCode() methods.
      Parameters:
      includeInEqualsAndHashCode - whether to include in the equals and hashCode methods
      Returns:
      updated builder instance
      See Also:
    • confidential

      public BUILDER confidential(boolean confidential)
      Whether this option is confidential (i.e. we should not print the value in toString method).
      Parameters:
      confidential - whether this option is confidential
      Returns:
      updated builder instance
      See Also:
    • registryService

      public BUILDER registryService(boolean registryService)
      Whether this option should be loaded from ServiceRegistry.
      Parameters:
      registryService - whether this option should be loaded from ServiceRegistry
      Returns:
      updated builder instance
      See Also:
    • sameGeneric

      public BUILDER sameGeneric(boolean sameGeneric)
      Whether this Map option is expected to have the same generic type for key and value. For example, for a Map<Class<?>, Instance<?>> that has sameGeneric set to true, we would generate singular method with signature <T> put(Class<T>, Instance<T>.
      Parameters:
      sameGeneric - whether a map has the same generic in key and value for a single mapping
      Returns:
      updated builder instance
      See Also:
    • required

      public BUILDER required(boolean required)
      Whether this is a required option. Will be true if:
      • an Option.Required is present in blueprint
      • the return type on blueprint is not Optional or a collection, and we do not support null
      Parameters:
      required - whether the option is required
      Returns:
      updated builder instance
      See Also:
    • builderOptionOnly

      public BUILDER builderOptionOnly(boolean builderOptionOnly)
      Set to true if this option is only available on the builder. In such a case the prototype and implementation will not have this option.
      Parameters:
      builderOptionOnly - builder option only
      Returns:
      updated builder instance
      See Also:
    • clearQualifiers

      public BUILDER clearQualifiers()
      Clear all qualifiers.
      Returns:
      updated builder instance
      See Also:
    • qualifiers

      public BUILDER qualifiers(List<? extends Annotation> qualifiers)
      List of qualifiers for this option.
      Parameters:
      qualifiers - service registry qualifiers defined on this option (to be used when getting a service registry instance)
      Returns:
      updated builder instance
      See Also:
    • addQualifiers

      public BUILDER addQualifiers(List<? extends Annotation> qualifiers)
      List of qualifiers for this option.
      Parameters:
      qualifiers - service registry qualifiers defined on this option (to be used when getting a service registry instance)
      Returns:
      updated builder instance
      See Also:
    • addQualifier

      public BUILDER addQualifier(Annotation qualifier)
      List of qualifiers for this option.
      Parameters:
      qualifier - add single service registry qualifiers defined on this option (to be used when getting a service registry instance)
      Returns:
      updated builder instance
      See Also:
    • addQualifier

      public BUILDER addQualifier(Consumer<Annotation.Builder> consumer)
      List of qualifiers for this option.
      Parameters:
      consumer - consumer of builder for service registry qualifiers defined on this option (to be used when getting a service registry instance)
      Returns:
      updated builder instance
      See Also:
    • clearAllowedValues

      public BUILDER clearAllowedValues()
      Clear all allowedValues.
      Returns:
      updated builder instance
      See Also:
    • allowedValues

      public BUILDER allowedValues(List<? extends OptionAllowedValue> allowedValues)
      List of allowed values for this option.
      Parameters:
      allowedValues - allowed values
      Returns:
      updated builder instance
      See Also:
    • addAllowedValues

      public BUILDER addAllowedValues(List<? extends OptionAllowedValue> allowedValues)
      List of allowed values for this option.
      Parameters:
      allowedValues - allowed values
      Returns:
      updated builder instance
      See Also:
    • addAllowedValue

      public BUILDER addAllowedValue(OptionAllowedValue allowedValue)
      List of allowed values for this option.
      Parameters:
      allowedValue - add single allowed values
      Returns:
      updated builder instance
      See Also:
    • addAllowedValue

      public BUILDER addAllowedValue(Consumer<OptionAllowedValue.Builder> consumer)
      List of allowed values for this option.
      Parameters:
      consumer - consumer of builder for allowed values
      Returns:
      updated builder instance
      See Also:
    • clearDefaultValue

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

      public BUILDER defaultValue(Consumer<ContentBuilder<?>> defaultValue)
      Default value for this option, a consumer of the field content builder.
      Parameters:
      defaultValue - default value consumer
      Returns:
      updated builder instance
      See Also:
    • clearConfigured

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

      public BUILDER configured(OptionConfigured configured)
      Details about configurability of this option.
      Parameters:
      configured - configured setup if configured
      Returns:
      updated builder instance
      See Also:
    • configured

      public BUILDER configured(Consumer<OptionConfigured.Builder> consumer)
      Details about configurability of this option.
      Parameters:
      consumer - consumer of builder of configured setup if configured
      Returns:
      updated builder instance
      See Also:
    • configured

      public BUILDER configured(Supplier<? extends OptionConfigured> supplier)
      Details about configurability of this option.
      Parameters:
      supplier - supplier of configured setup if configured
      Returns:
      updated builder instance
      See Also:
    • clearDeprecation

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

      public BUILDER deprecation(OptionDeprecation deprecation)
      Deprecation details.
      Parameters:
      deprecation - deprecation details, if present
      Returns:
      updated builder instance
      See Also:
    • deprecation

      public BUILDER deprecation(Consumer<OptionDeprecation.Builder> consumer)
      Deprecation details.
      Parameters:
      consumer - consumer of builder of deprecation details, if present
      Returns:
      updated builder instance
      See Also:
    • deprecation

      public BUILDER deprecation(Supplier<? extends OptionDeprecation> supplier)
      Deprecation details.
      Parameters:
      supplier - supplier of deprecation details, if present
      Returns:
      updated builder instance
      See Also:
    • clearProvider

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

      public BUILDER provider(OptionProvider provider)
      Provider details.
      Parameters:
      provider - provider details, if present
      Returns:
      updated builder instance
      See Also:
    • provider

      public BUILDER provider(Consumer<OptionProvider.Builder> consumer)
      Provider details.
      Parameters:
      consumer - consumer of builder of provider details, if present
      Returns:
      updated builder instance
      See Also:
    • provider

      public BUILDER provider(Supplier<? extends OptionProvider> supplier)
      Provider details.
      Parameters:
      supplier - supplier of provider details, if present
      Returns:
      updated builder instance
      See Also:
    • clearSingular

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

      public BUILDER singular(OptionSingular singular)
      Singular option details.
      Parameters:
      singular - singular setter name and related information, if present
      Returns:
      updated builder instance
      See Also:
    • singular

      public BUILDER singular(Consumer<OptionSingular.Builder> consumer)
      Singular option details.
      Parameters:
      consumer - consumer of builder of singular setter name and related information, if present
      Returns:
      updated builder instance
      See Also:
    • singular

      public BUILDER singular(Supplier<? extends OptionSingular> supplier)
      Singular option details.
      Parameters:
      supplier - supplier of singular setter name and related information, if present
      Returns:
      updated builder instance
      See Also:
    • accessModifier

      public BUILDER accessModifier(AccessModifier accessModifier)
      Access modifier of generated setter methods on builder. Note that prototype methods are declared in an interface, so these must always be public.
      Parameters:
      accessModifier - access modifier to use
      Returns:
      updated builder instance
      See Also:
    • clearBuilderInfo

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

      public BUILDER builderInfo(OptionBuilder builderInfo)
      If the option has a builder, return its information.
      Parameters:
      builderInfo - builder information, if present
      Returns:
      updated builder instance
      See Also:
    • builderInfo

      public BUILDER builderInfo(Consumer<OptionBuilder.Builder> consumer)
      If the option has a builder, return its information.
      Parameters:
      consumer - consumer of builder of builder information, if present
      Returns:
      updated builder instance
      See Also:
    • builderInfo

      public BUILDER builderInfo(Supplier<? extends OptionBuilder> supplier)
      If the option has a builder, return its information.
      Parameters:
      supplier - supplier of builder information, if present
      Returns:
      updated builder instance
      See Also:
    • clearRuntimeType

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

      public BUILDER runtimeType(RuntimeTypeInfo runtimeType)
      Custom runtime type factory method.
      Parameters:
      runtimeType - runtime type factory method, if present
      Returns:
      updated builder instance
      See Also:
    • runtimeType

      public BUILDER runtimeType(Consumer<RuntimeTypeInfo.Builder> consumer)
      Custom runtime type factory method.
      Parameters:
      consumer - consumer of builder of runtime type factory method, if present
      Returns:
      updated builder instance
      See Also:
    • runtimeType

      public BUILDER runtimeType(Supplier<? extends RuntimeTypeInfo> supplier)
      Custom runtime type factory method.
      Parameters:
      supplier - supplier of runtime type factory method, if present
      Returns:
      updated builder instance
      See Also:
    • clearDescription

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

      public BUILDER description(String description)
      Description of this option, used in Javadoc as the main text if defined.
      Parameters:
      description - description, if present
      Returns:
      updated builder instance
      See Also:
    • clearParamDescription

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

      public BUILDER paramDescription(String paramDescription)
      Parameter/return type description, used in Javadoc as the param/return description.
      Parameters:
      paramDescription - parameter description, if present
      Returns:
      updated builder instance
      See Also:
    • clearPrototypedBy

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

      public BUILDER prototypedBy(TypeName prototypedBy)
      A prototype that can build this option type.
      Parameters:
      prototypedBy - prototyped by type, or empty if not annotated
      Returns:
      updated builder instance
      See Also:
    • prototypedBy

      public BUILDER prototypedBy(Consumer<TypeName.Builder> consumer)
      A prototype that can build this option type.
      Parameters:
      consumer - consumer of builder of prototyped by type, or empty if not annotated
      Returns:
      updated builder instance
      See Also:
    • prototypedBy

      public BUILDER prototypedBy(Supplier<? extends TypeName> supplier)
      A prototype that can build this option type.
      Parameters:
      supplier - supplier of prototyped by type, or empty if not annotated
      Returns:
      updated builder instance
      See Also:
    • clearAnnotations

      public BUILDER clearAnnotations()
      Clear all annotations.
      Returns:
      updated builder instance
      See Also:
    • annotations

      public BUILDER annotations(List<? extends Annotation> annotations)
      Annotations option. Defined in Annotated.annotations()
      Parameters:
      annotations - the annotations option
      Returns:
      updated builder instance
      See Also:
    • addAnnotations

      public BUILDER addAnnotations(List<? extends Annotation> annotations)
      Annotations option. Defined in Annotated.annotations()
      Parameters:
      annotations - the annotations option
      Returns:
      updated builder instance
      See Also:
    • addAnnotation

      public BUILDER addAnnotation(Annotation annotation)
      Annotations option. Defined in Annotated.annotations()
      Parameters:
      annotation - add single the annotations option
      Returns:
      updated builder instance
      See Also:
    • addAnnotation

      public BUILDER addAnnotation(Consumer<Annotation.Builder> consumer)
      Annotations option. Defined in Annotated.annotations()
      Parameters:
      consumer - consumer of builder for the annotations option
      Returns:
      updated builder instance
      See Also:
    • clearInheritedAnnotations

      public BUILDER clearInheritedAnnotations()
      Clear all inheritedAnnotations.
      Returns:
      updated builder instance
      See Also:
    • inheritedAnnotations

      public BUILDER inheritedAnnotations(List<? extends Annotation> inheritedAnnotations)
      InheritedAnnotations option. Defined in Annotated.inheritedAnnotations()
      Parameters:
      inheritedAnnotations - the inheritedAnnotations option
      Returns:
      updated builder instance
      See Also:
    • addInheritedAnnotations

      public BUILDER addInheritedAnnotations(List<? extends Annotation> inheritedAnnotations)
      InheritedAnnotations option. Defined in Annotated.inheritedAnnotations()
      Parameters:
      inheritedAnnotations - the inheritedAnnotations option
      Returns:
      updated builder instance
      See Also:
    • addInheritedAnnotation

      public BUILDER addInheritedAnnotation(Annotation inheritedAnnotation)
      InheritedAnnotations option. Defined in Annotated.inheritedAnnotations()
      Parameters:
      inheritedAnnotation - add single the inheritedAnnotations option
      Returns:
      updated builder instance
      See Also:
    • addInheritedAnnotation

      public BUILDER addInheritedAnnotation(Consumer<Annotation.Builder> consumer)
      InheritedAnnotations option. Defined in Annotated.inheritedAnnotations()
      Parameters:
      consumer - consumer of builder for the inheritedAnnotations option
      Returns:
      updated builder instance
      See Also:
    • interfaceMethod

      public Optional<TypedElementInfo> interfaceMethod()
      Blueprint method if created from blueprint, or interface method if inherited from non-blueprint interface. Empty in case this is a "synthetic" option.
      Returns:
      interface method, if present
    • declaringType

      public Optional<TypeInfo> declaringType()
      Type that declares this option. This may be the blueprint type, or an interface type. In case this is a "synthetic" option, there is not type to use.
      Returns:
      type that declares this option, if present
    • name

      public Optional<String> name()
      Option name.
      Returns:
      name of this option
    • getterName

      public Optional<String> getterName()
      Name of the getter methods.
      Returns:
      getter method name
    • setterName

      public Optional<String> setterName()
      Name of the setter method(s).
      Returns:
      setter method name
    • declaredType

      public Optional<TypeName> declaredType()
      The return type of the blueprint method, or the type expected in getter of the option.
      Returns:
      declared type
    • decorator

      public Optional<TypeName> decorator()
      Option decorator type.
      Returns:
      type of the option decorator, if present
    • includeInToString

      public boolean includeInToString()
      Whether to include this option in generated Object.toString() method.
      Returns:
      whether to include in the toString method
    • includeInEqualsAndHashCode

      public boolean includeInEqualsAndHashCode()
      Whether to include this option in generated Object.equals(Object) and Object.hashCode() methods.
      Returns:
      whether to include in the equals and hashCode methods
    • confidential

      public boolean confidential()
      Whether this option is confidential (i.e. we should not print the value in toString method).
      Returns:
      whether this option is confidential
    • registryService

      public boolean registryService()
      Whether this option should be loaded from ServiceRegistry.
      Returns:
      whether this option should be loaded from ServiceRegistry
    • sameGeneric

      public boolean sameGeneric()
      Whether this Map option is expected to have the same generic type for key and value. For example, for a Map<Class<?>, Instance<?>> that has sameGeneric set to true, we would generate singular method with signature <T> put(Class<T>, Instance<T>.
      Returns:
      whether a map has the same generic in key and value for a single mapping
    • required

      public boolean required()
      Whether this is a required option. Will be true if:
      • an Option.Required is present in blueprint
      • the return type on blueprint is not Optional or a collection, and we do not support null
      Returns:
      whether the option is required
    • builderOptionOnly

      public boolean builderOptionOnly()
      Set to true if this option is only available on the builder. In such a case the prototype and implementation will not have this option.
      Returns:
      builder option only
    • qualifiers

      public List<Annotation> qualifiers()
      List of qualifiers for this option.
      Returns:
      service registry qualifiers defined on this option (to be used when getting a service registry instance)
    • allowedValues

      public List<OptionAllowedValue> allowedValues()
      List of allowed values for this option.
      Returns:
      allowed values
    • defaultValue

      public Optional<Consumer<ContentBuilder<?>>> defaultValue()
      Default value for this option, a consumer of the field content builder.
      Returns:
      default value consumer
    • configured

      public Optional<OptionConfigured> configured()
      Details about configurability of this option.
      Returns:
      configured setup if configured
    • deprecation

      public Optional<OptionDeprecation> deprecation()
      Deprecation details.
      Returns:
      deprecation details, if present
    • provider

      public Optional<OptionProvider> provider()
      Provider details.
      Returns:
      provider details, if present
    • singular

      public Optional<OptionSingular> singular()
      Singular option details.
      Returns:
      singular setter name and related information, if present
    • accessModifier

      public AccessModifier accessModifier()
      Access modifier of generated setter methods on builder. Note that prototype methods are declared in an interface, so these must always be public.
      Returns:
      access modifier to use
    • builderInfo

      public Optional<OptionBuilder> builderInfo()
      If the option has a builder, return its information.
      Returns:
      builder information, if present
    • runtimeType

      public Optional<RuntimeTypeInfo> runtimeType()
      Custom runtime type factory method.
      Returns:
      runtime type factory method, if present
    • description

      public Optional<String> description()
      Description of this option, used in Javadoc as the main text if defined.
      Returns:
      description, if present
    • paramDescription

      public Optional<String> paramDescription()
      Parameter/return type description, used in Javadoc as the param/return description.
      Returns:
      parameter description, if present
    • prototypedBy

      public Optional<TypeName> prototypedBy()
      A prototype that can build this option type.
      Returns:
      prototyped by type, or empty if not annotated
    • annotations

      public List<Annotation> annotations()
      Annotations option. Defined in Annotated.annotations()
      Returns:
      the annotations option
    • inheritedAnnotations

      public List<Annotation> inheritedAnnotations()
      InheritedAnnotations option. Defined in Annotated.inheritedAnnotations()
      Returns:
      the inheritedAnnotations option
    • toString

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

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

      protected void validatePrototype()
      Validates required properties.