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

java.lang.Object
io.helidon.integrations.langchain4j.providers.mock.MockChatRuleConfig.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:
MockChatRuleConfig.Builder
Enclosing interface:
MockChatRuleConfig

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

    • BuilderBase

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

    • from

      public BUILDER from(MockChatRuleConfig 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(MockChatRuleConfig.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 MockChatRuleConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends MockChatRuleConfig>
      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 MockChatRuleConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends MockChatRuleConfig>
      Parameters:
      config - configuration instance used to obtain values to update this builder
      Returns:
      updated builder instance
    • pattern

      public BUILDER pattern(Pattern pattern)
      The regular expression pattern that this rule matches.
      Parameters:
      pattern - regular expression pattern
      Returns:
      updated builder instance
      See Also:
    • clearResponse

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

      public BUILDER response(String response)
      Static text response that will be returned when the pattern matches.
      Parameters:
      response - static text response
      Returns:
      updated builder instance
      See Also:
    • clearTemplate

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

      public BUILDER template(String template)
      Response template (e.g., using placeholders ex.: '$1' for regex pattern group 1) used when the pattern matches.
      Parameters:
      template - optional template string
      Returns:
      updated builder instance
      See Also:
    • pattern

      public Optional<Pattern> pattern()
      The regular expression pattern that this rule matches.
      Returns:
      regular expression pattern
    • response

      public Optional<String> response()
      Static text response that will be returned when the pattern matches.
      Returns:
      static text response
    • template

      public Optional<String> template()
      Response template (e.g., using placeholders ex.: '$1' for regex pattern group 1) used when the pattern matches.
      Returns:
      optional template string
    • 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