Class TestProcessorHelper.TestDocumentBuilder

java.lang.Object
ai.pipestream.module.pipelineprobe.TestProcessorHelper.TestDocumentBuilder
Enclosing class:
TestProcessorHelper

public static class TestProcessorHelper.TestDocumentBuilder extends Object
Builder for creating test documents with various configurations.
  • Constructor Details

    • TestDocumentBuilder

      public TestDocumentBuilder()
      Creates a builder with a random doc id and no title, body, or custom fields.
  • Method Details

    • withDocId

      Sets the doc id, overriding the default random one.
      Parameters:
      docId - the doc id to use
      Returns:
      this builder
    • withTitle

      Sets the document title.
      Parameters:
      title - the title to set on the search metadata
      Returns:
      this builder
    • withBody

      Sets the document body.
      Parameters:
      body - the body to set on the search metadata
      Returns:
      this builder
    • withCustomField

      public TestProcessorHelper.TestDocumentBuilder withCustomField(String key, String value)
      Adds a string-valued custom field.
      Parameters:
      key - the custom field name
      value - the string value
      Returns:
      this builder
    • withCustomField

      public TestProcessorHelper.TestDocumentBuilder withCustomField(String key, boolean value)
      Adds a boolean-valued custom field.
      Parameters:
      key - the custom field name
      value - the boolean value
      Returns:
      this builder
    • withCustomField

      public TestProcessorHelper.TestDocumentBuilder withCustomField(String key, double value)
      Adds a numeric custom field.
      Parameters:
      key - the custom field name
      value - the numeric value
      Returns:
      this builder
    • build

      public ai.pipestream.data.v1.PipeDoc build()
      Builds the PipeDoc with document-type "test" search metadata, including the title, body, and any custom fields set so far.
      Returns:
      the built test document