DateTimePrompt 类
- java.
lang. Object - com.
microsoft. bot. dialogs. Dialog - com.
microsoft. bot. dialogs. prompts. Prompt<T> - com.
microsoft. bot. dialogs. prompts. DateTimePrompt
- com.
- com.
- com.
public class DateTimePrompt
extends Prompt<java.util.List<DateTimeResolution>>
提示用户输入日期时间值。
构造函数摘要
构造函数 | 说明 |
---|---|
DateTimePrompt(String dialogId, PromptValidator<List<DateTimeResolution>> validator, String defaultLocale) |
初始化 DateTimePrompt 类的新实例。 |
方法摘要
修饰符和类型 | 方法和描述 |
---|---|
java.lang.String |
getDefaultLocale()
获取用于确定提示语言特定行为的默认区域设置。 |
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 |
setDefaultLocale(String defaultLocale)
设置用于确定提示语言特定行为的默认区域设置。 |
方法继承自 Dialog
方法继承自 Prompt
方法继承自 java.lang.Object
构造函数详细信息
DateTimePrompt
public DateTimePrompt(String dialogId, PromptValidator<>
初始化 DateTimePrompt 类的新实例。
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.
方法详细信息
getDefaultLocale
public String getDefaultLocale()
获取用于确定提示语言特定行为的默认区域设置。
Returns:
onPrompt
protected CompletableFuture
提示用户输入。
Overrides:
DateTimePrompt.onPrompt(TurnContext turnContext, Map<String,Object> state, PromptOptions options, Boolean isRetry)Parameters:
Returns:
onRecognize
protected CompletableFuture<><>
尝试将用户的输入识别为日期时间值。
Overrides:
DateTimePrompt.onRecognize(TurnContext turnContext, Map<String,Object> state, PromptOptions options)Parameters:
Returns:
setDefaultLocale
public void setDefaultLocale(String defaultLocale)
设置用于确定提示语言特定行为的默认区域设置。
Parameters: