Class TextInputImpl
- java.lang.Object
-
- org.javacord.core.entity.message.component.ComponentImpl
-
- org.javacord.core.entity.message.component.TextInputImpl
-
- All Implemented Interfaces:
Component
,LowLevelComponent
,TextInput
,Specializable<LowLevelComponent>
public class TextInputImpl extends ComponentImpl implements TextInput
-
-
Constructor Summary
Constructors Constructor Description TextInputImpl(com.fasterxml.jackson.databind.JsonNode data)
Creates a new text input.TextInputImpl(TextInputStyle style, java.lang.String label, java.lang.String customId, java.lang.String value, java.lang.String placeholder, boolean required, java.lang.Integer minimumLength, java.lang.Integer maximumLength)
Creates a new Text Input.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getCustomId()
java.util.Optional<java.lang.String>
getLabel()
java.util.Optional<java.lang.Integer>
getMaximumLength()
java.util.Optional<java.lang.Integer>
getMinimumLength()
java.util.Optional<java.lang.String>
getPlaceholder()
java.util.Optional<TextInputStyle>
getStyle()
java.lang.String
getValue()
boolean
isRequired()
com.fasterxml.jackson.databind.node.ObjectNode
toJsonNode()
Gets the Component as aObjectNode
.com.fasterxml.jackson.databind.node.ObjectNode
toJsonNode(com.fasterxml.jackson.databind.node.ObjectNode object)
Gets the text input as aObjectNode
.-
Methods inherited from class org.javacord.core.entity.message.component.ComponentImpl
getType
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.javacord.api.entity.message.component.LowLevelComponent
asButton, asSelectMenu, asTextInput, isButton, isSelectMenu, isTextInput
-
Methods inherited from interface org.javacord.api.util.Specializable
as
-
-
-
-
Constructor Detail
-
TextInputImpl
public TextInputImpl(com.fasterxml.jackson.databind.JsonNode data)
Creates a new text input.- Parameters:
data
- The json data of the text input.
-
TextInputImpl
public TextInputImpl(TextInputStyle style, java.lang.String label, java.lang.String customId, java.lang.String value, java.lang.String placeholder, boolean required, java.lang.Integer minimumLength, java.lang.Integer maximumLength)
Creates a new Text Input.- Parameters:
style
- The text input's style.label
- The text input's label.customId
- The text input's custom ID.value
- The text input's value.placeholder
- The text input's placeholder.required
- Whether the text input is a required component.minimumLength
- The text input's minimum length.maximumLength
- The text input's maximum length.
-
-
Method Detail
-
getStyle
public java.util.Optional<TextInputStyle> getStyle()
-
getCustomId
public java.lang.String getCustomId()
- Specified by:
getCustomId
in interfaceTextInput
-
getLabel
public java.util.Optional<java.lang.String> getLabel()
-
getMinimumLength
public java.util.Optional<java.lang.Integer> getMinimumLength()
- Specified by:
getMinimumLength
in interfaceTextInput
-
getMaximumLength
public java.util.Optional<java.lang.Integer> getMaximumLength()
- Specified by:
getMaximumLength
in interfaceTextInput
-
isRequired
public boolean isRequired()
- Specified by:
isRequired
in interfaceTextInput
-
getPlaceholder
public java.util.Optional<java.lang.String> getPlaceholder()
- Specified by:
getPlaceholder
in interfaceTextInput
-
toJsonNode
public com.fasterxml.jackson.databind.node.ObjectNode toJsonNode()
Description copied from class:ComponentImpl
Gets the Component as aObjectNode
. This is what is sent to Discord.- Specified by:
toJsonNode
in classComponentImpl
- Returns:
- The component as a ObjectNode.
-
toJsonNode
public com.fasterxml.jackson.databind.node.ObjectNode toJsonNode(com.fasterxml.jackson.databind.node.ObjectNode object)
Gets the text input as aObjectNode
. This is what is sent to Discord.- Parameters:
object
- The object, the data should be added to.- Returns:
- The text input as a ObjectNode.
-
-