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 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 a TextInputDefinition record class.
      Parameters:
      parameter - the value for the parameter record component
      label - the value for the label record component
      placeholder - the value for the placeholder record component
      defaultValue - the value for the defaultValue record component
      minValue - the value for the minValue record component
      maxValue - the value for the maxValue record component
      style - the value for the style record component
      required - the value for the required record component
  • Method Details

    • build

    • with

      public ModalDefinition.TextInputDefinition with(net.dv8tion.jda.api.interactions.components.text.TextInput.Builder textInput)
      Builds a new ModalDefinition.TextInputDefinition from the given TextInput.Builder.
      Parameters:
      textInput - the TextInput to build the ModalDefinition.TextInputDefinition from
      Returns:
      the new ModalDefinition.TextInputDefinition
    • displayName

      public String displayName()
      Description copied from interface: Definition
      The human-readable name of this definition.
      Specified by:
      displayName in interface Definition
    • toJDAEntity

      public net.dv8tion.jda.api.interactions.components.text.TextInput toJDAEntity()
      Transforms this definition into a TextInput.
      Specified by:
      toJDAEntity in interface JDAEntity<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 a TextInput.Builder.
      Returns:
      the TextInput.Builder
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • parameter

      public ParameterDescription parameter()
      Returns the value of the parameter record component.
      Returns:
      the value of the parameter record component
    • label

      public String label()
      Returns the value of the label record component.
      Returns:
      the value of the label record component
    • placeholder

      public @Nullable String placeholder()
      Returns the value of the placeholder record component.
      Returns:
      the value of the placeholder record component
    • defaultValue

      public @Nullable String defaultValue()
      Returns the value of the defaultValue record component.
      Returns:
      the value of the defaultValue record component
    • minValue

      public int minValue()
      Returns the value of the minValue record component.
      Returns:
      the value of the minValue record component
    • maxValue

      public int maxValue()
      Returns the value of the maxValue record component.
      Returns:
      the value of the maxValue record component
    • style

      public net.dv8tion.jda.api.interactions.components.text.TextInputStyle style()
      Returns the value of the style record component.
      Returns:
      the value of the style record component
    • required

      public boolean required()
      Returns the value of the required record component.
      Returns:
      the value of the required record component