DateTimePrompt Class
- 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>>
Prompts a user for a date-time value.
Constructor Summary
| Constructor | Description |
|---|---|
| DateTimePrompt(String dialogId, PromptValidator<List<DateTimeResolution>> validator, String defaultLocale) |
Initializes a new instance of the DateTimePrompt class. |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
| java.lang.String |
getDefaultLocale()
Gets the default locale used to determine language-specific behavior of the prompt. |
| protected java.util.concurrent.CompletableFuture<java.lang.Void> |
onPrompt(TurnContext turnContext, Map<String,Object> state, PromptOptions options, Boolean isRetry)
Prompts the user for input. |
|
protected
java.util.concurrent.CompletableFuture<Prompt |
onRecognize(TurnContext turnContext, Map<String,Object> state, PromptOptions options)
Attempts to recognize the user's input as a date-time value. |
| void |
setDefaultLocale(String defaultLocale)
Sets the default locale used to determine language-specific behavior of the prompt. |
Methods inherited from Dialog
Methods inherited from Prompt
Methods inherited from java.lang.Object
Constructor Details
DateTimePrompt
public DateTimePrompt(String dialogId, PromptValidator> validator, String defaultLocale)
Initializes a new instance of the DateTimePrompt class.
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.
Method Details
getDefaultLocale
public String getDefaultLocale()
Gets the default locale used to determine language-specific behavior of the prompt.
Returns:
onPrompt
protected CompletableFuture
Prompts the user for input.
Overrides:
DateTimePrompt.onPrompt(TurnContext turnContext, Map<String,Object> state, PromptOptions options, Boolean isRetry)Parameters:
Returns:
onRecognize
protected CompletableFuture
Attempts to recognize the user's input as a date-time value.
Overrides:
DateTimePrompt.onRecognize(TurnContext turnContext, Map<String,Object> state, PromptOptions options)Parameters:
Returns:
setDefaultLocale
public void setDefaultLocale(String defaultLocale)
Sets the default locale used to determine language-specific behavior of the prompt.
Parameters: