Interface IPromptTextInputParamsBuilder
public interface IPromptTextInputParamsBuilder
Builder for extracting
prompt text parameters from a given configuration object.- Since:
- 8.5.0
-
Method Summary
Modifier and TypeMethodDescriptionconnectionConfig(Object connectionConfig) Sets the connection configuration object to scan for prompt text parameters.extract()Extracts the names of allprompt text parametersfrom the given configuration object via reflection, recursively.queryConfig(Object queryConfig) Sets the query configuration object to scan for prompt text parameters.booleanupdate(List<PromptTextParameter> params) Extracts the names of allprompt text parametersviaextract(), and updates the given list of prompt text parameters accordingly.
-
Method Details
-
queryConfig
Sets the query configuration object to scan for prompt text parameters.- Parameters:
queryConfig- The (deserialized) configuration object of a prompt query to scan for prompt text parameters.- Returns:
- This builder for chaining method calls.
-
connectionConfig
Sets the connection configuration object to scan for prompt text parameters. Must correspond to the connection that was configured for the query.- Parameters:
connectionConfig- The (deserialized) configuration object of the prompt connection used by the query.- Returns:
- This builder for chaining method calls.
-
extract
Extracts the names of allprompt text parametersfrom the given configuration object via reflection, recursively. Considers all fields annotated withPromptTextParamsthat are either of typeStringor aCollectionofStringvalues; respecting conditions set viaApplicableIf. Assumes the string values contains placeholders in the format[%param.<name>%], where<name>is the name of the parameter. Returns a set of all such names.The given connection configuration must correspond to the connection selected for the query, and is made available as the
context.connectionparameter when evaluatingApplicableIfconditions.- Returns:
- A set of names of prompt text parameters found in the configuration object.
-
update
Extracts the names of allprompt text parametersviaextract(), and updates the given list of prompt text parameters accordingly. Removes any parameters from the list that are not present in the configuration object, and adds new parameters for any names found in the configuration that are not already in the list. Newly added parameters are marked asrequiredand do not have alabelordescription.Respects conditions set via
ApplicableIf. The given connection configuration must correspond to the connection selected for the query, and is made available as thecontext.connectionparameter when evaluatingApplicableIfconditions.- Parameters:
params- The list of prompt text parameters to update. This list will be modified in place.- Returns:
- true if the list was changed in any way (i.e., if any parameters were added or removed),
-