ConfirmPrompt 类
- 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>
提示用户使用“是/否”响应确认某些内容。
构造函数摘要
方法摘要
修饰符和类型 | 方法和描述 |
---|---|
Choice |
getChoiceOptions()
获取传递给 的其他选项, ChoiceFactory 并用于调整呈现给用户的选项样式。 |
org.javatuples.Pair<Choice,Choice> |
getConfirmChoices()
获取提示的“是”和“否 Choice ”。 |
java.lang.String |
getDefaultLocale()
设置或设置用于确定提示语言特定行为的默认区域设置。 |
List |
getStyle()
获取向用户显示提示时要使用的样式。 |
protected java.util.concurrent.CompletableFuture<java.lang.Void> |
onPrompt(TurnContext turnContext, Map<String,Object> state, PromptOptions options, Boolean isRetry)
提示用户输入。 |
protected
java.util.concurrent.CompletableFuture<Prompt |
onRecognize(TurnContext turnContext, Map<String,Object> state, PromptOptions options)
尝试识别用户的输入。 |
void |
setChoiceOptions(ChoiceFactoryOptions choiceOptions)
设置传递给 ChoiceFactory 的其他选项,并用于调整呈现给用户的选项样式。 |
void |
setConfirmChoices(Pair<Choice,Choice> confirmChoices)
为提示设置“是”和“否 Choice ”。 |
void |
setDefaultLocale(String defaultLocale)
设置用于确定提示语言特定行为的默认区域设置。 |
void |
setStyle(ListStyle style)
设置向用户显示提示时要使用的样式。 |
方法继承自 Dialog
方法继承自 Prompt
方法继承自 java.lang.Object
构造函数详细信息
ConfirmPrompt
ConfirmPrompt
public ConfirmPrompt(String dialogId, PromptValidator
初始化 ConfirmPrompt 类的新实例。
Parameters:
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<>
初始化 ConfirmPrompt 类的新实例。
Parameters:
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.
方法详细信息
getChoiceOptions
public ChoiceFactoryOptions getChoiceOptions()
获取传递给 的其他选项, ChoiceFactory 并用于调整呈现给用户的选项样式。
Returns:
getConfirmChoices
getDefaultLocale
public String getDefaultLocale()
设置或设置用于确定提示语言特定行为的默认区域设置。
Returns:
getStyle
public ListStyle getStyle()
获取向用户显示提示时要使用的样式。
Returns:
onPrompt
protected CompletableFuture
提示用户输入。
Overrides:
ConfirmPrompt.onPrompt(TurnContext turnContext, Map<String,Object> state, PromptOptions options, Boolean isRetry)Parameters:
Returns:
onRecognize
protected CompletableFuture<>
尝试识别用户的输入。
Overrides:
ConfirmPrompt.onRecognize(TurnContext turnContext, Map<String,Object> state, PromptOptions options)Parameters:
Returns:
setChoiceOptions
public void setChoiceOptions(ChoiceFactoryOptions choiceOptions)
设置传递给 ChoiceFactory 的其他选项,并用于调整呈现给用户的选项样式。
Parameters:
setConfirmChoices
setDefaultLocale
public void setDefaultLocale(String defaultLocale)
设置用于确定提示语言特定行为的默认区域设置。
Parameters:
setStyle
public void setStyle(ListStyle style)
设置向用户显示提示时要使用的样式。
Parameters: