T
- The type of the responsepublic abstract static class AbstractResponseProvider.Builder<T> extends Object
AbstractResponseProvider
.Constructor and Description |
---|
AbstractResponseProvider.Builder() |
Modifier and Type | Method and Description |
---|---|
AbstractResponseProvider.Builder<T> |
add(ResponseProvider.OutputMatcher<T> outputMatcher)
Adds the given
ResponseProvider.OutputMatcher entry. |
AbstractResponseProvider.Builder<T> |
addExact(String exactPrompt,
Function<String,T> dynamicResponse)
Creates a new
ResponseProvider.OutputMatcher entry that matches a prompt
exactly and replies dynamically. |
AbstractResponseProvider.Builder<T> |
addExact(String exactPrompt,
T exactResponse)
Creates a new
ResponseProvider.OutputMatcher entry that matches a prompt
exactly and replies exactly. |
AbstractResponseProvider.Builder<T> |
addPredicate(Predicate<String> dynamicPrompt,
Function<String,T> dynamicResponse)
Creates a new
ResponseProvider.OutputMatcher entry that matches a prompt
dynamically and replies dynamically. |
AbstractResponseProvider.Builder<T> |
addPredicate(Predicate<String> dynamicPrompt,
T exactResponse)
Creates a new
ResponseProvider.OutputMatcher entry that matches a prompt
dynamically and replies exactly. |
AbstractResponseProvider.Builder<T> |
addRegex(String regexPrompt,
Function<String,T> dynamicResponse)
Creates a new
ResponseProvider.OutputMatcher entry that matches a prompt using
a regular expression and replies dynamically. |
AbstractResponseProvider.Builder<T> |
addRegex(String regexPrompt,
T exactResponse)
Creates a new
ResponseProvider.OutputMatcher entry that matches a prompt using
a regular expression and replies exactly. |
abstract AbstractResponseProvider<T> |
build() |
public AbstractResponseProvider.Builder<T> addExact(String exactPrompt, T exactResponse)
ResponseProvider.OutputMatcher
entry that matches a prompt
exactly and replies exactly.exactPrompt
- The exact string to matchexactResponse
- The exact response to reply withBuilder
public AbstractResponseProvider.Builder<T> addRegex(String regexPrompt, T exactResponse)
ResponseProvider.OutputMatcher
entry that matches a prompt using
a regular expression and replies exactly.regexPrompt
- The regular expression that a prompt must matchexactResponse
- The exact response to reply withBuilder
public AbstractResponseProvider.Builder<T> addExact(String exactPrompt, Function<String,T> dynamicResponse)
ResponseProvider.OutputMatcher
entry that matches a prompt
exactly and replies dynamically.exactPrompt
- The exact string that a prompt must matchdynamicResponse
- The Function<String, T>
to call to get
the response to the promptBuilder
public AbstractResponseProvider.Builder<T> addRegex(String regexPrompt, Function<String,T> dynamicResponse)
ResponseProvider.OutputMatcher
entry that matches a prompt using
a regular expression and replies dynamically.regexPrompt
- The regular expression that a prompt must matchdynamicResponse
- The Function<String, T>
to call to get
the response to the promptBuilder
public AbstractResponseProvider.Builder<T> addPredicate(Predicate<String> dynamicPrompt, T exactResponse)
ResponseProvider.OutputMatcher
entry that matches a prompt
dynamically and replies exactly.dynamicPrompt
- The Predicate<String>
used to determine
if a prompt matchesexactResponse
- The exact response to reply withBuilder
public AbstractResponseProvider.Builder<T> addPredicate(Predicate<String> dynamicPrompt, Function<String,T> dynamicResponse)
ResponseProvider.OutputMatcher
entry that matches a prompt
dynamically and replies dynamically.dynamicPrompt
- The Predicate<String>
used to determine
if a prompt matchesdynamicResponse
- The Function<String, T>
to call to get
the response to the promptBuilder
public AbstractResponseProvider.Builder<T> add(ResponseProvider.OutputMatcher<T> outputMatcher)
ResponseProvider.OutputMatcher
entry.outputMatcher
- The OutputMatcher
to addBuilder
public abstract AbstractResponseProvider<T> build()
AbstractResponseProvider