ConfirmPrompt Classe
- java.
lang. Object - com.
microsoft. bot. dialogs. Dialog - com.
microsoft. bot. dialogs. prompts. Prompt<T> - com.
microsoft. bot. dialogs. prompts. ConfirmPrompt
- com.
- com.
- com.
public class ConfirmPrompt
extends Prompt<java.lang.Boolean>
Richiede a un utente di confermare un elemento con una risposta sì/no.
Riepilogo dei costruttori
| Costruttore | Descrizione |
|---|---|
| ConfirmPrompt(String dialogId) |
Inizializza una nuova istanza della classe ConfirmPrompt. |
| ConfirmPrompt(String dialogId, PromptValidator<Boolean> validator, String defaultLocale) |
Inizializza una nuova istanza della classe ConfirmPrompt. |
| ConfirmPrompt(String dialogId, Map<String,Triplet<Choice,Choice,ChoiceFactoryOptions>> choiceDefaults, PromptValidator<Boolean> validator, String defaultLocale) |
Inizializza una nuova istanza della classe ConfirmPrompt. |
Riepilogo dei metodi
| Modificatore e tipo | Metodo e descrizione |
|---|---|
|
Choice |
getChoiceOptions()
Ottiene opzioni aggiuntive passate al ChoiceFactory e utilizzate per modificare lo stile delle scelte di cui è stato eseguito il rendering all'utente. |
| org.javatuples.Pair<Choice,Choice> |
getConfirmChoices()
Ottiene l'Choice sì e no per il prompt. |
| java.lang.String |
getDefaultLocale()
Imposta o imposta le impostazioni locali predefinite utilizzate per determinare il comportamento specifico della lingua del prompt. |
|
List |
getStyle()
Ottiene lo stile da utilizzare quando si presenta la richiesta all'utente. |
| protected java.util.concurrent.CompletableFuture<java.lang.Void> |
onPrompt(TurnContext turnContext, Map<String,Object> state, PromptOptions options, Boolean isRetry)
Richiede l'input all'utente. |
|
protected
java.util.concurrent.CompletableFuture<Prompt |
onRecognize(TurnContext turnContext, Map<String,Object> state, PromptOptions options)
Tenta di riconoscere l'input dell'utente. |
| void |
setChoiceOptions(ChoiceFactoryOptions choiceOptions)
Imposta opzioni aggiuntive passate al ChoiceFactory e utilizzate per modificare lo stile delle scelte di cui è stato eseguito il rendering all'utente. |
| void |
setConfirmChoices(Pair<Choice,Choice> confirmChoices)
Imposta il Choice sì e no per il prompt. |
| void |
setDefaultLocale(String defaultLocale)
Imposta le impostazioni locali predefinite utilizzate per determinare il comportamento specifico della lingua del prompt. |
| void |
setStyle(ListStyle style)
Imposta lo stile da utilizzare quando si presenta la richiesta all'utente. |
Metodi ereditati da Dialog
Metodi ereditati da Prompt
Metodi ereditati da java.lang.Object
Dettagli costruttore
ConfirmPrompt
public ConfirmPrompt(String dialogId)
Inizializza una nuova istanza della classe ConfirmPrompt.
Parametri:
ConfirmPrompt
public ConfirmPrompt(String dialogId, PromptValidator
Inizializza una nuova istanza della classe ConfirmPrompt.
Parametri:
The value of <xref uid="" data-throw-if-not-resolved="false" data-raw-source="dialogId"></xref> must be unique within the
<xref uid="com.microsoft.bot.dialogs.DialogSet" data-throw-if-not-resolved="false" data-raw-source="DialogSet"></xref> or <xref uid="com.microsoft.bot.dialogs.ComponentDialog" data-throw-if-not-resolved="false" data-raw-source="ComponentDialog"></xref> to which
the prompt is added. If the <xref uid="com.microsoft.bot.schema.Activity.locale" data-throw-if-not-resolved="false" data-raw-source="Activity#locale"></xref> of
the <xref uid="com.microsoft.bot.dialogs.DialogContext" data-throw-if-not-resolved="false" data-raw-source="DialogContext"></xref> .<xref uid="com.microsoft.bot.dialogs.DialogContext.context" data-throw-if-not-resolved="false" data-raw-source="DialogContext#context"></xref>
.<xref uid="" data-throw-if-not-resolved="false" data-raw-source="ITurnContext#activity"></xref> is specified, then that
local is used to determine language specific behavior;
otherwise the <xref uid="" data-throw-if-not-resolved="false" data-raw-source="defaultLocale"></xref> is used. US-English
is the used if no language or default locale is
available, or if the language or locale is not otherwise
supported.
ConfirmPrompt
public ConfirmPrompt(String dialogId, Map
Inizializza una nuova istanza della classe ConfirmPrompt.
Parametri:
The value of <xref uid="" data-throw-if-not-resolved="false" data-raw-source="dialogId"></xref> must be unique within the
<xref uid="com.microsoft.bot.dialogs.DialogSet" data-throw-if-not-resolved="false" data-raw-source="DialogSet"></xref> or <xref uid="com.microsoft.bot.dialogs.ComponentDialog" data-throw-if-not-resolved="false" data-raw-source="ComponentDialog"></xref> to which
the prompt is added. If the <xref uid="com.microsoft.bot.schema.Activity.locale" data-throw-if-not-resolved="false" data-raw-source="Activity#locale"></xref> of
the <xref uid="com.microsoft.bot.dialogs.DialogContext" data-throw-if-not-resolved="false" data-raw-source="DialogContext"></xref>
.<xref uid="com.microsoft.bot.dialogs.DialogContext.context" data-throw-if-not-resolved="false" data-raw-source="DialogContext#context"></xref>
.<xref uid="" data-throw-if-not-resolved="false" data-raw-source="ITurnContext#activity"></xref> is specified, then that
local is used to determine language specific behavior;
otherwise the <xref uid="" data-throw-if-not-resolved="false" data-raw-source="defaultLocale"></xref> is used. US-English
is the used if no language or default locale is
available, or if the language or locale is not
otherwise supported.
Dettagli metodo
getChoiceOptions
public ChoiceFactoryOptions getChoiceOptions()
Ottiene opzioni aggiuntive passate al ChoiceFactory e utilizzate per modificare lo stile delle scelte di cui è stato eseguito il rendering all'utente.
Restituisce:
getConfirmChoices
getDefaultLocale
public String getDefaultLocale()
Imposta o imposta le impostazioni locali predefinite utilizzate per determinare il comportamento specifico della lingua del prompt.
Restituisce:
getStyle
public ListStyle getStyle()
Ottiene lo stile da utilizzare quando si presenta la richiesta all'utente.
Restituisce:
onPrompt
protected CompletableFuture
Richiede l'input all'utente.
Override:
ConfirmPrompt.onPrompt(TurnContext turnContext, Map<String,Object> state, PromptOptions options, Boolean isRetry)Parametri:
Restituisce:
onRecognize
protected CompletableFuture
Tenta di riconoscere l'input dell'utente.
Override:
ConfirmPrompt.onRecognize(TurnContext turnContext, Map<String,Object> state, PromptOptions options)Parametri:
Restituisce:
setChoiceOptions
public void setChoiceOptions(ChoiceFactoryOptions choiceOptions)
Imposta opzioni aggiuntive passate al ChoiceFactory e utilizzate per modificare lo stile delle scelte di cui è stato eseguito il rendering all'utente.
Parametri:
setConfirmChoices
setDefaultLocale
public void setDefaultLocale(String defaultLocale)
Imposta le impostazioni locali predefinite utilizzate per determinare il comportamento specifico della lingua del prompt.
Parametri:
setStyle
public void setStyle(ListStyle style)
Imposta lo stile da utilizzare quando si presenta la richiesta all'utente.
Parametri: