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>>
提示使用者輸入日期時間值。
建構函式摘要
| 建構函式 | Description |
|---|---|
| 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> validator, String defaultLocale)
初始化 DateTimePrompt 類別的新實例。
參數:
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()
取得用來判斷提示語言特定行為的預設地區設定。
傳回:
onPrompt
protected CompletableFuture
提示用戶輸入。
覆寫:
DateTimePrompt.onPrompt(TurnContext turnContext, Map<String,Object> state, PromptOptions options, Boolean isRetry)參數:
傳回:
onRecognize
protected CompletableFuture
嘗試將使用者的輸入辨識為日期時間值。
覆寫:
DateTimePrompt.onRecognize(TurnContext turnContext, Map<String,Object> state, PromptOptions options)參數:
傳回:
setDefaultLocale
public void setDefaultLocale(String defaultLocale)
設定用來判斷提示語言特定行為的預設地區設定。
參數: