Record Class ModalDefinition.TextInputDefinition
java.lang.Object
java.lang.Record
com.github.kaktushose.jda.commands.definitions.interactions.ModalDefinition.TextInputDefinition
- All Implemented Interfaces:
Definition
,JDAEntity<TextInput>
- Enclosing class:
ModalDefinition
public static record ModalDefinition.TextInputDefinition(@NotNull String label, @NotNull String placeholder, @NotNull String defaultValue, int minValue, int maxValue, @NotNull TextInputStyle style, boolean required)
extends Record
implements JDAEntity<TextInput>, Definition
Representation of a modal text input defined by
TextInput
-
Constructor Summary
ConstructorDescriptionTextInputDefinition
(@NotNull String label, @NotNull String placeholder, @NotNull String defaultValue, int minValue, int maxValue, @NotNull TextInputStyle style, boolean required) Creates an instance of aTextInputDefinition
record class. -
Method Summary
Modifier and TypeMethodDescriptionbuild
(ParameterDescription parameter) Builds a newModalDefinition.TextInputDefinition
from the givenParameterDescription
@NotNull String
Returns the value of thedefaultValue
record component.@NotNull String
The human-readable name of this definition.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.@NotNull String
label()
Returns the value of thelabel
record component.int
maxValue()
Returns the value of themaxValue
record component.int
minValue()
Returns the value of theminValue
record component.@NotNull String
Returns the value of theplaceholder
record component.boolean
required()
Returns the value of therequired
record component.@NotNull TextInputStyle
style()
Returns the value of thestyle
record component.@NotNull TextInput
Transforms this definition into aTextInput
.final String
toString()
Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.github.kaktushose.jda.commands.definitions.Definition
definitionId
-
Constructor Details
-
TextInputDefinition
public TextInputDefinition(@NotNull @NotNull String label, @NotNull @NotNull String placeholder, @NotNull @NotNull String defaultValue, int minValue, int maxValue, @NotNull @NotNull TextInputStyle style, boolean required) Creates an instance of aTextInputDefinition
record class.- Parameters:
label
- the value for thelabel
record componentplaceholder
- the value for theplaceholder
record componentdefaultValue
- the value for thedefaultValue
record componentminValue
- the value for theminValue
record componentmaxValue
- the value for themaxValue
record componentstyle
- the value for thestyle
record componentrequired
- the value for therequired
record component
-
-
Method Details
-
build
Builds a newModalDefinition.TextInputDefinition
from the givenParameterDescription
- Parameters:
parameter
- theParameterDescription
to build theModalDefinition.TextInputDefinition
from- Returns:
- the new
ModalDefinition.TextInputDefinition
-
displayName
Description copied from interface:Definition
The human-readable name of this definition.- Specified by:
displayName
in interfaceDefinition
-
toJDAEntity
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with thecompare
method from their corresponding wrapper classes. -
label
Returns the value of thelabel
record component.- Returns:
- the value of the
label
record component
-
placeholder
Returns the value of theplaceholder
record component.- Returns:
- the value of the
placeholder
record component
-
defaultValue
Returns the value of thedefaultValue
record component.- Returns:
- the value of the
defaultValue
record component
-
minValue
public int minValue()Returns the value of theminValue
record component.- Returns:
- the value of the
minValue
record component
-
maxValue
public int maxValue()Returns the value of themaxValue
record component.- Returns:
- the value of the
maxValue
record component
-
style
Returns the value of thestyle
record component.- Returns:
- the value of the
style
record component
-
required
public boolean required()Returns the value of therequired
record component.- Returns:
- the value of the
required
record component
-