Record Class ModalDefinition.TextInputDefinition
java.lang.Object
java.lang.Record
io.github.kaktushose.jdac.definitions.interactions.ModalDefinition.TextInputDefinition
- All Implemented Interfaces:
Definition, JDAEntity<net.dv8tion.jda.api.interactions.components.text.TextInput>
- Enclosing class:
ModalDefinition
public static record ModalDefinition.TextInputDefinition(ParameterDescription parameter, String label, @Nullable String placeholder, @Nullable String defaultValue, int minValue, int maxValue, net.dv8tion.jda.api.interactions.components.text.TextInputStyle style, boolean required)
extends Record
implements JDAEntity<net.dv8tion.jda.api.interactions.components.text.TextInput>, Definition
Representation of a modal text input defined by
TextInput-
Constructor Summary
ConstructorsConstructorDescriptionTextInputDefinition(ParameterDescription parameter, String label, @Nullable String placeholder, @Nullable String defaultValue, int minValue, int maxValue, net.dv8tion.jda.api.interactions.components.text.TextInputStyle style, boolean required) Creates an instance of aTextInputDefinitionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbuild(ParameterDescription parameter) Builds a newModalDefinition.TextInputDefinitionfrom the givenParameterDescription@Nullable StringReturns the value of thedefaultValuerecord component.The human-readable name of this definition.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.label()Returns the value of thelabelrecord component.intmaxValue()Returns the value of themaxValuerecord component.intminValue()Returns the value of theminValuerecord component.Returns the value of theparameterrecord component.@Nullable StringReturns the value of theplaceholderrecord component.booleanrequired()Returns the value of therequiredrecord component.net.dv8tion.jda.api.interactions.components.text.TextInputStylestyle()Returns the value of thestylerecord component.net.dv8tion.jda.api.interactions.components.text.TextInput.BuilderTransforms this definition into aTextInput.Builder.net.dv8tion.jda.api.interactions.components.text.TextInputTransforms this definition into aTextInput.final StringtoString()Returns a string representation of this record class.with(net.dv8tion.jda.api.interactions.components.text.TextInput.Builder textInput) Builds a newModalDefinition.TextInputDefinitionfrom the givenTextInput.Builder.Methods inherited from interface Definition
definitionId
-
Constructor Details
-
TextInputDefinition
public TextInputDefinition(ParameterDescription parameter, String label, @Nullable String placeholder, @Nullable String defaultValue, int minValue, int maxValue, net.dv8tion.jda.api.interactions.components.text.TextInputStyle style, boolean required) Creates an instance of aTextInputDefinitionrecord class.- Parameters:
parameter- the value for theparameterrecord componentlabel- the value for thelabelrecord componentplaceholder- the value for theplaceholderrecord componentdefaultValue- the value for thedefaultValuerecord componentminValue- the value for theminValuerecord componentmaxValue- the value for themaxValuerecord componentstyle- the value for thestylerecord componentrequired- the value for therequiredrecord component
-
-
Method Details
-
build
Builds a newModalDefinition.TextInputDefinitionfrom the givenParameterDescription- Parameters:
parameter- theParameterDescriptionto build theModalDefinition.TextInputDefinitionfrom- Returns:
- the new
ModalDefinition.TextInputDefinition
-
with
public ModalDefinition.TextInputDefinition with(net.dv8tion.jda.api.interactions.components.text.TextInput.Builder textInput) Builds a newModalDefinition.TextInputDefinitionfrom the givenTextInput.Builder.- Parameters:
textInput- theTextInputto build theModalDefinition.TextInputDefinitionfrom- Returns:
- the new
ModalDefinition.TextInputDefinition
-
displayName
Description copied from interface:DefinitionThe human-readable name of this definition.- Specified by:
displayNamein interfaceDefinition
-
toJDAEntity
public net.dv8tion.jda.api.interactions.components.text.TextInput toJDAEntity()Transforms this definition into aTextInput.- Specified by:
toJDAEntityin interfaceJDAEntity<net.dv8tion.jda.api.interactions.components.text.TextInput>- Returns:
- the
TextInput
-
toBuilder
public net.dv8tion.jda.api.interactions.components.text.TextInput.Builder toBuilder()Transforms this definition into aTextInput.Builder.- Returns:
- the
TextInput.Builder
-
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 thecomparemethod from their corresponding wrapper classes. -
parameter
Returns the value of theparameterrecord component.- Returns:
- the value of the
parameterrecord component
-
label
Returns the value of thelabelrecord component.- Returns:
- the value of the
labelrecord component
-
placeholder
Returns the value of theplaceholderrecord component.- Returns:
- the value of the
placeholderrecord component
-
defaultValue
Returns the value of thedefaultValuerecord component.- Returns:
- the value of the
defaultValuerecord component
-
minValue
public int minValue()Returns the value of theminValuerecord component.- Returns:
- the value of the
minValuerecord component
-
maxValue
public int maxValue()Returns the value of themaxValuerecord component.- Returns:
- the value of the
maxValuerecord component
-
style
public net.dv8tion.jda.api.interactions.components.text.TextInputStyle style()Returns the value of thestylerecord component.- Returns:
- the value of the
stylerecord component
-
required
public boolean required()Returns the value of therequiredrecord component.- Returns:
- the value of the
requiredrecord component
-