Choice Class

  • java.lang.Object
    • com.microsoft.bot.dialogs.choices.Choice

public class Choice

Represents a choice for a choice prompt.

Constructor Summary

Constructor Description
Choice()

Creates a Choice.

Choice(String withValue)

Creates a Choice.

Choice(String withValue, String[] withSynonyms)

Creates a Choice.

Choice(String withValue, List<String> withSynonyms)

Creates a Choice.

Method Summary

Modifier and Type Method and Description
CardAction getAction()

Gets the action to use when rendering the choice as a suggested action or hero card.

java.util.List<java.lang.String> getSynonyms()

Gets the list of synonyms to recognize in addition to the value.

java.lang.String getValue()

Gets the value to return when selected.

void setAction(CardAction withAction)

Sets the action to use when rendering the choice as a suggested action or hero card.

void setSynonyms(List<String> withSynonyms)

Sets the list of synonyms to recognize in addition to the value.

void setValue(String withValue)

Sets the value to return when selected.

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

Choice

public Choice()

Creates a Choice.

Choice

public Choice(String withValue)

Creates a Choice.

Parameters:

withValue - The value.

Choice

public Choice(String withValue, String[] withSynonyms)

Creates a Choice.

Parameters:

withValue - The value.
withSynonyms - The list of synonyms to recognize in addition to the value.

Choice

public Choice(String withValue, List withSynonyms)

Creates a Choice.

Parameters:

withValue - The value.
withSynonyms - The list of synonyms to recognize in addition to the value.

Method Details

getAction

public CardAction getAction()

Gets the action to use when rendering the choice as a suggested action or hero card.

Returns:

The action to use.

getSynonyms

public List getSynonyms()

Gets the list of synonyms to recognize in addition to the value. This is optional.

Returns:

The list of synonyms.

getValue

public String getValue()

Gets the value to return when selected.

Returns:

The value.

setAction

public void setAction(CardAction withAction)

Sets the action to use when rendering the choice as a suggested action or hero card.

Parameters:

withAction - The action to use.

setSynonyms

public void setSynonyms(List withSynonyms)

Sets the list of synonyms to recognize in addition to the value. This is optional.

Parameters:

withSynonyms - The list of synonyms.

setValue

public void setValue(String withValue)

Sets the value to return when selected.

Parameters:

withValue - The value to return.

Applies to