PromptValidatorContext<T> Class

  • java.lang.Object
    • com.microsoft.bot.dialogs.prompts.PromptValidatorContext<T>

Type Parameters

T

Type for this Context

public class PromptValidatorContext<T>

Contains context information for a {@link PromptValidator{T}} .

Constructor Summary

Constructor Description
PromptValidatorContext(TurnContext turnContext, PromptRecognizerResult<T> recognized, Map<String,Object> state, PromptOptions options)

Create a PromptValidatorContext Instance.

Method Summary

Modifier and Type Method and Description
int getAttemptCount()

Gets the number of times this instance of the prompt has been executed.

TurnContext getContext()

Gets the TurnContext for the current turn of conversation with the user.

PromptOptions getOptions()

Gets the PromptOptions used for this recognition attempt.

PromptRecognizerResult<T> getRecognized()

Gets the {@link PromptRecognizerResult{T}} returned from the prompt's recognition attempt.

java.util.Map<java.lang.String,java.lang.Object> getState()

Gets state for the associated prompt instance.

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Constructor Details

PromptValidatorContext

public PromptValidatorContext(TurnContext turnContext, PromptRecognizerResult recognized, Map state, PromptOptions options)

Create a PromptValidatorContext Instance.

Parameters:

turnContext - Context for the current turn of conversation with the user.
recognized - The recognition results from the prompt's recognition attempt.
state - State for the associated prompt instance.
options - The prompt options used for this recognition attempt.

Method Details

getAttemptCount

public int getAttemptCount()

Gets the number of times this instance of the prompt has been executed. This count is set when the prompt is added to the dialog stack.

Returns:

the attempt count.

getContext

public TurnContext getContext()

Gets the TurnContext for the current turn of conversation with the user.

Returns:

Context for the current turn of conversation with the user.

getOptions

public PromptOptions getOptions()

Gets the PromptOptions used for this recognition attempt.

Returns:

The prompt options used for this recognition attempt.

getRecognized

public PromptRecognizerResult getRecognized()

Gets the {@link PromptRecognizerResult{T}} returned from the prompt's recognition attempt.

Returns:

The recognition results from the prompt's recognition attempt.

getState

public Map getState()

Gets state for the associated prompt instance.

Returns:

State for the associated prompt instance.

Applies to