Record Class StringSelectMenuDefinition.MenuOptionDefinition

java.lang.Object
java.lang.Record
io.github.kaktushose.jdac.definitions.interactions.component.menu.StringSelectMenuDefinition.MenuOptionDefinition
Record Components:
value - the value of the select option
label - the label of the select option
description - the description of the select option
emoji - the Emoji of the select option or null
isDefault - whether the select option is a default value
All Implemented Interfaces:
Definition, JDAEntity<net.dv8tion.jda.api.components.selections.SelectOption>
Enclosing class:
StringSelectMenuDefinition

public static record StringSelectMenuDefinition.MenuOptionDefinition(String value, String label, @Nullable String description, @Nullable net.dv8tion.jda.api.entities.emoji.Emoji emoji, boolean isDefault) extends Record implements JDAEntity<net.dv8tion.jda.api.components.selections.SelectOption>, Definition
Representation of a select option for a string select menu defined by a MenuOption.
  • Constructor Details

    • MenuOptionDefinition

      public MenuOptionDefinition(net.dv8tion.jda.api.components.selections.SelectOption option)
    • MenuOptionDefinition

      public MenuOptionDefinition(String value, String label, @Nullable String description, @Nullable net.dv8tion.jda.api.entities.emoji.Emoji emoji, boolean isDefault)
      Creates an instance of a MenuOptionDefinition record class.
      Parameters:
      value - the value for the value record component
      label - the value for the label record component
      description - the value for the description record component
      emoji - the value for the emoji record component
      isDefault - the value for the isDefault record component
  • Method Details

    • build

    • 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.components.selections.SelectOption toJDAEntity()
      Transforms this definition into a SelectOption.
      Specified by:
      toJDAEntity in interface JDAEntity<net.dv8tion.jda.api.components.selections.SelectOption>
      Returns:
      a JDA entity of type T
    • 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.
    • value

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

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

      public @Nullable String description()
      Returns the value of the description record component.
      Returns:
      the value of the description record component
    • emoji

      public @Nullable net.dv8tion.jda.api.entities.emoji.Emoji emoji()
      Returns the value of the emoji record component.
      Returns:
      the value of the emoji record component
    • isDefault

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