Class TestProcessorHelper.TestDocumentBuilder
java.lang.Object
ai.pipestream.module.pipelineprobe.TestProcessorHelper.TestDocumentBuilder
- Enclosing class:
TestProcessorHelper
Builder for creating test documents with various configurations.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a builder with a random doc id and no title, body, or custom fields. -
Method Summary
Modifier and TypeMethodDescriptionai.pipestream.data.v1.PipeDocbuild()Builds thePipeDocwith document-type"test"search metadata, including the title, body, and any custom fields set so far.Sets the document body.withCustomField(String key, boolean value) Adds a boolean-valued custom field.withCustomField(String key, double value) Adds a numeric custom field.withCustomField(String key, String value) Adds a string-valued custom field.Sets the doc id, overriding the default random one.Sets the document title.
-
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
Adds a string-valued custom field.- Parameters:
key- the custom field namevalue- the string value- Returns:
- this builder
-
withCustomField
Adds a boolean-valued custom field.- Parameters:
key- the custom field namevalue- the boolean value- Returns:
- this builder
-
withCustomField
Adds a numeric custom field.- Parameters:
key- the custom field namevalue- the numeric value- Returns:
- this builder
-
build
public ai.pipestream.data.v1.PipeDoc build()Builds thePipeDocwith document-type"test"search metadata, including the title, body, and any custom fields set so far.- Returns:
- the built test document
-