Class SelectMenuBuilder
- java.lang.Object
-
- org.javacord.api.entity.message.component.SelectMenuBuilder
-
- All Implemented Interfaces:
ComponentBuilder,LowLevelComponentBuilder
public class SelectMenuBuilder extends java.lang.Object implements LowLevelComponentBuilder
-
-
Constructor Summary
Constructors Constructor Description SelectMenuBuilder(ComponentType type, java.lang.String customId)Create a new SelectMenuBuilder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SelectMenuBuilderaddChannelType(ChannelType channelType)Add a channel type to the select menu.SelectMenuBuilderaddChannelTypes(java.lang.Iterable<ChannelType> channelTypes)Adds all given channel types to the select menu.SelectMenuBuilderaddOption(SelectMenuOption selectMenuOption)Add an option to the select menu.SelectMenuBuilderaddOptions(java.util.List<SelectMenuOption> selectMenuOptions)Adds all given options to the select menu.SelectMenubuild()Creates aSelectMenuinstance with the given values.SelectMenuBuildercopy(SelectMenu selectMenu)Create a copy of an existing select menu.SelectMenuBuilderDelegategetDelegate()Get the builder delegate.ComponentTypegetType()Get the type of component being built.SelectMenuBuilderremoveAllOptions()Removes all options from the select menu.SelectMenuBuilderremoveOption(SelectMenuOption selectMenuOption)Remove an option from the select menu.SelectMenuBuildersetCustomId(java.lang.String customId)Set the custom ID for the select menu.SelectMenuBuildersetDisabled(boolean isDisabled)Set if the select menu should be disabled.SelectMenuBuildersetMaximumValues(int maximumValues)Set the maximum amount of options which can be selected.SelectMenuBuildersetMinimumValues(int minimumValues)Set the minimum amount of options which must be selected.SelectMenuBuildersetPlaceholder(java.lang.String placeholder)Set the placeholder for the select menu.
-
-
-
Constructor Detail
-
SelectMenuBuilder
public SelectMenuBuilder(ComponentType type, java.lang.String customId)
Create a new SelectMenuBuilder.- Parameters:
type- The type of SelectMenu to create.customId- The custom id of the SelectMenu.
-
-
Method Detail
-
getType
public ComponentType getType()
Description copied from interface:ComponentBuilderGet the type of component being built.- Specified by:
getTypein interfaceComponentBuilder- Returns:
- The type of component being built.
-
getDelegate
public SelectMenuBuilderDelegate getDelegate()
Description copied from interface:ComponentBuilderGet the builder delegate.- Specified by:
getDelegatein interfaceComponentBuilder- Returns:
- The builder delegate.
-
setPlaceholder
public SelectMenuBuilder setPlaceholder(java.lang.String placeholder)
Set the placeholder for the select menu.- Parameters:
placeholder- The placeholder.- Returns:
- The builder.
-
setMinimumValues
public SelectMenuBuilder setMinimumValues(int minimumValues)
Set the minimum amount of options which must be selected.- Parameters:
minimumValues- The minimum values.- Returns:
- The builder.
-
setMaximumValues
public SelectMenuBuilder setMaximumValues(int maximumValues)
Set the maximum amount of options which can be selected.- Parameters:
maximumValues- The maximum values.- Returns:
- The builder.
-
setCustomId
public SelectMenuBuilder setCustomId(java.lang.String customId)
Set the custom ID for the select menu.- Parameters:
customId- The custom ID.- Returns:
- The builder.
-
addChannelType
public SelectMenuBuilder addChannelType(ChannelType channelType)
Add a channel type to the select menu.Only usable with
ComponentType.SELECT_MENU_CHANNEL.- Parameters:
channelType- The channel type to add.- Returns:
- The builder.
-
addChannelTypes
public SelectMenuBuilder addChannelTypes(java.lang.Iterable<ChannelType> channelTypes)
Adds all given channel types to the select menu.Only usable with
ComponentType.SELECT_MENU_CHANNEL.- Parameters:
channelTypes- The channel types to add.- Returns:
- The builder.
-
addOption
public SelectMenuBuilder addOption(SelectMenuOption selectMenuOption)
Add an option to the select menu.Only usable with
ComponentType.SELECT_MENU_STRING.- Parameters:
selectMenuOption- The option.- Returns:
- The builder.
-
removeOption
public SelectMenuBuilder removeOption(SelectMenuOption selectMenuOption)
Remove an option from the select menu.Only usable with
ComponentType.SELECT_MENU_STRING.- Parameters:
selectMenuOption- The option.- Returns:
- The builder.
-
addOptions
public SelectMenuBuilder addOptions(java.util.List<SelectMenuOption> selectMenuOptions)
Adds all given options to the select menu.Only usable with
ComponentType.SELECT_MENU_STRING.- Parameters:
selectMenuOptions- The options.- Returns:
- The builder.
-
removeAllOptions
public SelectMenuBuilder removeAllOptions()
Removes all options from the select menu.Only usable with
ComponentType.SELECT_MENU_STRING.- Returns:
- The builder.
-
setDisabled
public SelectMenuBuilder setDisabled(boolean isDisabled)
Set if the select menu should be disabled.- Parameters:
isDisabled- Is disabled.- Returns:
- The builder.
-
copy
public SelectMenuBuilder copy(SelectMenu selectMenu)
Create a copy of an existing select menu.- Parameters:
selectMenu- The select menu to copy.- Returns:
- The select menu builder.
-
build
public SelectMenu build()
Creates aSelectMenuinstance with the given values.- Returns:
- The created select menu instance.
-
-