Class TextInputImpl
java.lang.Object
net.dv8tion.jda.internal.components.AbstractComponentImpl
net.dv8tion.jda.internal.components.textinput.TextInputImpl
- All Implemented Interfaces:
ActionComponent
,ActionRowChildComponent
,ActionRowChildComponentUnion
,IDisableable
,Component
,IComponentUnion
,TextInput
,SerializableData
public class TextInputImpl
extends AbstractComponentImpl
implements TextInput, ActionRowChildComponentUnion
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.dv8tion.jda.api.components.Component
Component.Type
Nested classes/interfaces inherited from interface net.dv8tion.jda.api.components.textinput.TextInput
TextInput.Builder
-
Field Summary
Fields inherited from interface net.dv8tion.jda.api.components.textinput.TextInput
MAX_ID_LENGTH, MAX_LABEL_LENGTH, MAX_PLACEHOLDER_LENGTH, MAX_VALUE_LENGTH
-
Constructor Summary
ConstructorsConstructorDescriptionTextInputImpl
(String id, int uniqueId, TextInputStyle style, String label, int minLength, int maxLength, boolean required, String value, String placeholder) TextInputImpl
(DataObject object) -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
The custom id of this TextInput component.getLabel()
The label of this TextInput component.int
The maximum amount of characters that can be written to submit the Modal.int
The minimum amount of characters that must be written to submit the Modal.The placeholder of this TextInput component.getStyle()
TheTextInputStyle
of this TextInput component.int
The unique, numeric identifier of this component.getValue()
The pre-defined value of this TextInput component.int
hashCode()
boolean
Whether this TextInput is required to be non-emptytoData()
SerializedDataObject
for this object.toString()
withUniqueId
(int uniqueId) Creates a new component with the provided numeric ID.Methods inherited from class net.dv8tion.jda.internal.components.AbstractComponentImpl
asActionRow, asButton, asContainer, asEntitySelectMenu, asFileDisplay, asMediaGallery, asSection, asSeparator, asStringSelectMenu, asTextDisplay, asTextInput, asThumbnail
Methods inherited from interface net.dv8tion.jda.api.components.ActionComponent
getId
Methods inherited from interface net.dv8tion.jda.api.components.actionrow.ActionRowChildComponentUnion
asButton, asEntitySelectMenu, asStringSelectMenu
Methods inherited from interface net.dv8tion.jda.api.components.Component
isMessageCompatible, isModalCompatible
Methods inherited from interface net.dv8tion.jda.api.components.IComponentUnion
isUnknownComponent
Methods inherited from interface net.dv8tion.jda.api.components.attribute.IDisableable
isEnabled
Methods inherited from interface net.dv8tion.jda.api.components.textinput.TextInput
asDisabled, asEnabled, getType, isDisabled, withDisabled
-
Constructor Details
-
TextInputImpl
-
TextInputImpl
public TextInputImpl(String id, int uniqueId, TextInputStyle style, String label, int minLength, int maxLength, boolean required, String value, String placeholder)
-
-
Method Details
-
withUniqueId
Description copied from interface:Component
Creates a new component with the provided numeric ID.
If no ID is set, Discord will generate IDs incrementally starting from 1 and will not use existing IDs from the same message/modal.- Specified by:
withUniqueId
in interfaceActionComponent
- Specified by:
withUniqueId
in interfaceActionRowChildComponent
- Specified by:
withUniqueId
in interfaceActionRowChildComponentUnion
- Specified by:
withUniqueId
in interfaceComponent
- Specified by:
withUniqueId
in interfaceIComponentUnion
- Specified by:
withUniqueId
in interfaceIDisableable
- Specified by:
withUniqueId
in interfaceTextInput
- Parameters:
uniqueId
- The new ID; must be higher or equal to 1- Returns:
- The new component
-
getStyle
Description copied from interface:TextInput
TheTextInputStyle
of this TextInput component. -
getCustomId
Description copied from interface:TextInput
The custom id of this TextInput component.This is used to uniquely identify the TextInput. Similar to
Buttons
.- Specified by:
getCustomId
in interfaceActionComponent
- Specified by:
getCustomId
in interfaceTextInput
- Returns:
- The custom id of this component.
- See Also:
-
getUniqueId
public int getUniqueId()Description copied from interface:Component
The unique, numeric identifier of this component.
Can be set manually or automatically assigned by Discord (starting from1
). If it has not been assigned yet, this will return-1
.Note: Older messages may return
0
.- Specified by:
getUniqueId
in interfaceComponent
- Returns:
- The unique identifier of this component, or
-1
if not assigned yet, or0
on older messages
-
getLabel
Description copied from interface:TextInput
The label of this TextInput component. -
getMinLength
public int getMinLength()Description copied from interface:TextInput
The minimum amount of characters that must be written to submit the Modal.This is -1 if no length has been set!
- Specified by:
getMinLength
in interfaceTextInput
- Returns:
- The minimum length of this TextInput component or -1
-
getMaxLength
public int getMaxLength()Description copied from interface:TextInput
The maximum amount of characters that can be written to submit the Modal.This is -1 if no length has been set!
- Specified by:
getMaxLength
in interfaceTextInput
- Returns:
- The maximum length of this TextInput component or -1
-
isRequired
public boolean isRequired()Description copied from interface:TextInput
Whether this TextInput is required to be non-empty- Specified by:
isRequired
in interfaceTextInput
- Returns:
- True if this TextInput is required to be used.
-
getValue
Description copied from interface:TextInput
The pre-defined value of this TextInput component.
If this is not null, sending a Modal with this component will pre-populate the field with this String.This is null if no pre-defined value has been set!
-
getPlaceHolder
Description copied from interface:TextInput
The placeholder of this TextInput component.
This is a short hint that describes the expected value of the TextInput field.This is null if no placeholder has been set!
- Specified by:
getPlaceHolder
in interfaceTextInput
- Returns:
- The placeholder of this TextInput component or null.
-
toData
Description copied from interface:SerializableData
SerializedDataObject
for this object.- Specified by:
toData
in interfaceSerializableData
- Returns:
DataObject
-
equals
-
hashCode
public int hashCode() -
toString
-