Interface IPromptTextInputParamsBuilder


public interface IPromptTextInputParamsBuilder
Builder for extracting prompt text parameters from a given configuration object.
Since:
8.5.0
  • Method Details

    • queryConfig

      @CanIgnoreReturnValue IPromptTextInputParamsBuilder queryConfig(Object 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

      @CanIgnoreReturnValue IPromptTextInputParamsBuilder connectionConfig(Object 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

      Set<String> extract()
      Extracts the names of all prompt text parameters from the given configuration object via reflection, recursively. Considers all fields annotated with PromptTextParams that are either of type String or a Collection of String values; respecting conditions set via ApplicableIf. 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.connection parameter when evaluating ApplicableIf conditions.

      Returns:
      A set of names of prompt text parameters found in the configuration object.
    • update

      boolean update(List<PromptTextParameter> params)
      Extracts the names of all prompt text parameters via extract(), 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 as required and do not have a label or description.

      Respects conditions set via ApplicableIf. The given connection configuration must correspond to the connection selected for the query, and is made available as the context.connection parameter when evaluating ApplicableIf conditions.

      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),