ChoiceFactoryOptions Class

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

public class ChoiceFactoryOptions

Contains formatting options for presenting a list of choices.

Field Summary

Modifier and Type Field and Description
static final boolean DEFAULT_INCLUDE_NUMBERS
static final java.lang.String DEFAULT_INLINE_OR
static final java.lang.String DEFAULT_INLINE_OR_MORE
static final java.lang.String DEFAULT_INLINE_SEPERATOR

Constructor Summary

Constructor Description
ChoiceFactoryOptions()

Creates default options.

ChoiceFactoryOptions(ChoiceFactoryOptions options)

Clones another options object, and applies defaults if needed.

ChoiceFactoryOptions(String withInlineSeparator, String withInlineOr, String withInlineOrMore)

Creates options with the specified formatting values.

ChoiceFactoryOptions(String withInlineSeparator, String withInlineOr, String withInlineOrMore, boolean withIncludeNumbers)

Initializes a new instance of the class.

Method Summary

Modifier and Type Method and Description
java.lang.Boolean getIncludeNumbers()

Gets a value indicating whether an inline and list style choices will be prefixed with the index of the choice; as in "1.

java.lang.String getInlineOr()

Gets the separator inserted between the choices when their are only 2 choices.

java.lang.String getInlineOrMore()

Gets the separator inserted between the last 2 choices when their are more than 2 choices.

java.lang.String getInlineSeparator()

Gets the character used to separate individual choices when there are more than 2 choices.

void setIncludeNumbers(Boolean withIncludeNumbers)

Sets the value indicating whether an inline and list style choices will be prefixed with the index of the choice.

void setInlineOr(String withInlineOr)

Sets the separator inserted between the choices when their are only 2 choices.

void setInlineOrMore(String withInlineOrMore)

Sets the separator inserted between the last 2 choices when their are more than 2 choices.

void setInlineSeparator(String withSeperator)

Sets the character used to separate individual choices when there are more than 2 choices.

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

Field Details

DEFAULT_INCLUDE_NUMBERS

public static final boolean DEFAULT_INCLUDE_NUMBERS

DEFAULT_INLINE_OR

public static final String DEFAULT_INLINE_OR

DEFAULT_INLINE_OR_MORE

public static final String DEFAULT_INLINE_OR_MORE

DEFAULT_INLINE_SEPERATOR

public static final String DEFAULT_INLINE_SEPERATOR

Constructor Details

ChoiceFactoryOptions

public ChoiceFactoryOptions()

Creates default options.

ChoiceFactoryOptions

public ChoiceFactoryOptions(ChoiceFactoryOptions options)

Clones another options object, and applies defaults if needed.

Parameters:

options - The options object to clone.

ChoiceFactoryOptions

public ChoiceFactoryOptions(String withInlineSeparator, String withInlineOr, String withInlineOrMore)

Creates options with the specified formatting values.

Parameters:

withInlineSeparator - The inline seperator value.
withInlineOr - The inline or value.
withInlineOrMore - The inline or more value.

ChoiceFactoryOptions

public ChoiceFactoryOptions(String withInlineSeparator, String withInlineOr, String withInlineOrMore, boolean withIncludeNumbers)

Initializes a new instance of the class. Refer to the code in teh ConfirmPrompt for an example of usage.

Parameters:

withInlineSeparator - The inline seperator value.
withInlineOr - The inline or value.
withInlineOrMore - The inline or more value.
withIncludeNumbers - Flag indicating whether to include numbers as a choice.

Method Details

getIncludeNumbers

public Boolean getIncludeNumbers()

Gets a value indicating whether an inline and list style choices will be prefixed with the index of the choice; as in "1. choice". If false, the list style will use a bulleted list instead. The default value is true.

Returns:

If false, the list style will use a bulleted list.

getInlineOr

public String getInlineOr()

Gets the separator inserted between the choices when their are only 2 choices. The default value is `" or "`. This is optional.

Returns:

The separator inserted between the choices when their are only 2 choices.

getInlineOrMore

public String getInlineOrMore()

Gets the separator inserted between the last 2 choices when their are more than 2 choices. The default value is `", or "`. This is optional.

Returns:

The separator inserted between the last 2 choices when their are more than 2 choices.

getInlineSeparator

public String getInlineSeparator()

Gets the character used to separate individual choices when there are more than 2 choices. The default value is `", "`. This is optional.

Returns:

The seperator.

setIncludeNumbers

public void setIncludeNumbers(Boolean withIncludeNumbers)

Sets the value indicating whether an inline and list style choices will be prefixed with the index of the choice.

Parameters:

withIncludeNumbers - If false, the list style will use a bulleted list instead.

setInlineOr

public void setInlineOr(String withInlineOr)

Sets the separator inserted between the choices when their are only 2 choices.

Parameters:

withInlineOr - The separator inserted between the choices when their are only 2 choices.

setInlineOrMore

public void setInlineOrMore(String withInlineOrMore)

Sets the separator inserted between the last 2 choices when their are more than 2 choices.

Parameters:

withInlineOrMore - The separator inserted between the last 2 choices when their are more than 2 choices.

setInlineSeparator

public void setInlineSeparator(String withSeperator)

Sets the character used to separate individual choices when there are more than 2 choices.

Parameters:

withSeperator - The seperator.

Applies to