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

java.lang.Object
io.helidon.common.context.http.ContextRecordConfig.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>, ConfigBuilderSupport.ConfiguredBuilder<BUILDER,PROTOTYPE>, ConfigBuilderSupport.ConfiguredBuilder<BUILDER,PROTOTYPE>
Direct Known Subclasses:
ContextRecordConfig.Builder
Enclosing interface:
ContextRecordConfig

public abstract static class ContextRecordConfig.BuilderBase<BUILDER extends ContextRecordConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends ContextRecordConfig> extends Object implements ConfigBuilderSupport.ConfiguredBuilder<BUILDER,PROTOTYPE>
Fluent API builder base for ContextRecordConfig.
  • Constructor Details

    • BuilderBase

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

    • from

      public BUILDER from(ContextRecordConfig 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(ContextRecordConfig.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
    • config

      @Deprecated public BUILDER config(Config config)
      Update builder from configuration (node of this type). If a value is present in configuration, it would override currently configured values.
      Specified by:
      config in interface ConfigBuilderSupport.ConfiguredBuilder<BUILDER extends ContextRecordConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends ContextRecordConfig>
      Parameters:
      config - configuration instance used to obtain values to update this builder
      Returns:
      updated builder instance
    • config

      public BUILDER config(Config config)
      Update builder from configuration (node of this type). If a value is present in configuration, it would override currently configured values.
      Specified by:
      config in interface ConfigBuilderSupport.ConfiguredBuilder<BUILDER extends ContextRecordConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends ContextRecordConfig>
      Parameters:
      config - configuration instance used to obtain values to update this builder
      Returns:
      updated builder instance
    • header

      public BUILDER header(HeaderName header)
      Name of the header to use when sending the context value over the network.
      Parameters:
      header - header name
      Returns:
      updated builder instance
      See Also:
    • clearClassifier

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

      public BUILDER classifier(String classifier)
      String classifier of the value that will be used with Context.get(Object, Class).
      Parameters:
      classifier - classifier to use, defaults to header name
      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(String defaultValue)
      Default value to send if not configured in context.
      Parameters:
      defaultValue - default value, used for non-array records, or when only a single value is desired as a default for array
      Returns:
      updated builder instance
      See Also:
    • clearDefaultValues

      public BUILDER clearDefaultValues()
      Clear all defaultValues.
      Returns:
      updated builder instance
      See Also:
    • defaultValues

      public BUILDER defaultValues(List<String> defaultValues)
      Default values to send if not configured in context. In case default values is an empty array, it will not be sent over the network if not present in context.
      Parameters:
      defaultValues - default values, used for array records; if this record is not an array, only the first value will be used
      Returns:
      updated builder instance
      See Also:
    • addDefaultValues

      public BUILDER addDefaultValues(List<String> defaultValues)
      Default values to send if not configured in context. In case default values is an empty array, it will not be sent over the network if not present in context.
      Parameters:
      defaultValues - default values, used for array records; if this record is not an array, only the first value will be used
      Returns:
      updated builder instance
      See Also:
    • addDefaultValue

      public BUILDER addDefaultValue(String defaultValue)
      Default values to send if not configured in context. In case default values is an empty array, it will not be sent over the network if not present in context.
      Parameters:
      defaultValue - add single default values, used for array records; if this record is not an array, only the first value will be used
      Returns:
      updated builder instance
      See Also:
    • array

      public BUILDER array(boolean array)
      Whether to treat the option as an array of strings. This would be read from the context as an array.
      Parameters:
      array - whether the record is an array
      Returns:
      updated builder instance
      See Also:
    • header

      public Optional<HeaderName> header()
      Name of the header to use when sending the context value over the network.
      Returns:
      header name
    • classifier

      public Optional<String> classifier()
      String classifier of the value that will be used with Context.get(Object, Class).
      Returns:
      classifier to use, defaults to header name
    • defaultValue

      public Optional<String> defaultValue()
      Default value to send if not configured in context.
      Returns:
      default value, used for non-array records, or when only a single value is desired as a default for array
    • defaultValues

      public List<String> defaultValues()
      Default values to send if not configured in context. In case default values is an empty array, it will not be sent over the network if not present in context.
      Returns:
      default values, used for array records; if this record is not an array, only the first value will be used
    • array

      public boolean array()
      Whether to treat the option as an array of strings. This would be read from the context as an array.
      Returns:
      whether the record is an array
    • toString

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

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

      protected void validatePrototype()
      Validates required properties.
    • config

      protected Optional<Config> config()
      Configuration used to configure this instance.
      Returns:
      config instance