Class TextInputBuilder
- java.lang.Object
-
- org.javacord.api.entity.message.component.TextInputBuilder
-
- All Implemented Interfaces:
ComponentBuilder,LowLevelComponentBuilder
public class TextInputBuilder extends java.lang.Object implements LowLevelComponentBuilder
-
-
Constructor Summary
Constructors Constructor Description TextInputBuilder(int style, java.lang.String customId, java.lang.String label)Creates a new text input builder.TextInputBuilder(TextInputStyle style, java.lang.String customId, java.lang.String label)Creates a new text input builder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TextInputbuild()Creates aTextInputinstance with the given values.TextInputBuildercopy(TextInput textInput)Copy a Text Input's value into this builder.TextInputBuilderDelegategetDelegate()Gets the delegate used by the component builder internally.ComponentTypegetType()Get the component's type (alwaysComponentType.TEXT_INPUT).TextInputBuildersetCustomId(java.lang.String customId)Set the Text Input's custom ID.TextInputBuildersetLabel(java.lang.String label)Set the Text Input's label.TextInputBuildersetMaximumLength(java.lang.Integer maximumLength)Set the Text Input's maximum length.TextInputBuildersetMinimumLength(java.lang.Integer minimumLength)Set the Text Input's minimum length.TextInputBuildersetPlaceholder(java.lang.String placeholder)Set the Text Input's placeholder.TextInputBuildersetRequired(boolean required)Set whether this Text Input is required.TextInputBuildersetStyle(int styleValue)Set the Text Input's style.TextInputBuildersetStyle(TextInputStyle style)Set the Text Input's style.TextInputBuildersetValue(java.lang.String value)Set the Text Input's value.
-
-
-
Constructor Detail
-
TextInputBuilder
public TextInputBuilder(TextInputStyle style, java.lang.String customId, java.lang.String label)
Creates a new text input builder.- Parameters:
style- The style of the text input.customId- The custom id of the text input.label- The label of the text input.
-
TextInputBuilder
public TextInputBuilder(int style, java.lang.String customId, java.lang.String label)Creates a new text input builder.- Parameters:
style- The style of the text input.customId- The custom id of the text input.label- The label of the text input.
-
-
Method Detail
-
copy
public TextInputBuilder copy(TextInput textInput)
Copy a Text Input's value into this builder.- Parameters:
textInput- The Text Input to copy.- Returns:
- The builder instance to chain methods.
-
getType
public ComponentType getType()
Get the component's type (alwaysComponentType.TEXT_INPUT).- Specified by:
getTypein interfaceComponentBuilder- Returns:
- The component's type.
-
setStyle
public TextInputBuilder setStyle(TextInputStyle style)
Set the Text Input's style.- Parameters:
style- A new Text Input style.- Returns:
- The builder instance to chain methods.
-
setStyle
public TextInputBuilder setStyle(int styleValue)
Set the Text Input's style.- Parameters:
styleValue- The style of the Text Input based on Discord's style values.- Returns:
- The current instance in order to chain call methods.
-
setLabel
public TextInputBuilder setLabel(java.lang.String label)
Set the Text Input's label.- Parameters:
label- The Text Input's label.- Returns:
- The current instance in order to chain call methods.
-
setPlaceholder
public TextInputBuilder setPlaceholder(java.lang.String placeholder)
Set the Text Input's placeholder.- Parameters:
placeholder- The Text Input's placeholder.- Returns:
- The current instance in order to chain call methods.
-
setValue
public TextInputBuilder setValue(java.lang.String value)
Set the Text Input's value.- Parameters:
value- The Text Input's value.- Returns:
- The current instance in order to chain call methods.
-
setMinimumLength
public TextInputBuilder setMinimumLength(java.lang.Integer minimumLength)
Set the Text Input's minimum length.- Parameters:
minimumLength- The Text Input's minimum length.- Returns:
- The current instance in order to chain call methods.
-
setMaximumLength
public TextInputBuilder setMaximumLength(java.lang.Integer maximumLength)
Set the Text Input's maximum length.- Parameters:
maximumLength- The Text Input's maximum length.- Returns:
- The current instance in order to chain call methods.
-
setCustomId
public TextInputBuilder setCustomId(java.lang.String customId)
Set the Text Input's custom ID.- Parameters:
customId- The Text Input's identifier.- Returns:
- The current instance in order to chain call methods.
-
setRequired
public TextInputBuilder setRequired(boolean required)
Set whether this Text Input is required.- Parameters:
required- Whether the Text Input is required or not.- Returns:
- The current instance in order to chain call methods.
-
build
public TextInput build()
Creates aTextInputinstance with the given values.- Returns:
- The created TextInput instance.
-
getDelegate
public TextInputBuilderDelegate getDelegate()
Gets the delegate used by the component builder internally.- Specified by:
getDelegatein interfaceComponentBuilder- Returns:
- The delegate used by this component builder internally.
-
-