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 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 a TextInputDefinition record class.
      Parameters:
      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

    • displayName

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

      @NotNull public @NotNull TextInput toJDAEntity()
      Transforms this definition into a TextInput.
      Specified by:
      toJDAEntity in interface JDAEntity<TextInput>
      Returns:
      the TextInput
    • 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.
    • label

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

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

      @NotNull public @NotNull 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

      @NotNull public @NotNull 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