Record Class StringSelectMenuDefinition.SelectOptionDefinition

java.lang.Object
java.lang.Record
com.github.kaktushose.jda.commands.definitions.interactions.component.menu.StringSelectMenuDefinition.SelectOptionDefinition
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<SelectOption>
Enclosing class:
StringSelectMenuDefinition

public static record StringSelectMenuDefinition.SelectOptionDefinition(@NotNull String value, @NotNull String label, @Nullable String description, @Nullable Emoji emoji, boolean isDefault) extends Record implements JDAEntity<SelectOption>, Definition
Representation of a select option for a string select menu defined by a SelectOption.
  • Constructor Details

    • SelectOptionDefinition

      public SelectOptionDefinition(@NotNull @NotNull String value, @NotNull @NotNull String label, @Nullable @Nullable String description, @Nullable @Nullable Emoji emoji, boolean isDefault)
      Creates an instance of a SelectOptionDefinition 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

      @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 SelectOption toJDAEntity()
      Transforms this definition into a SelectOption.
      Specified by:
      toJDAEntity in interface JDAEntity<SelectOption>
      Returns:
      a JDA entity of type JDAEntity
    • 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

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

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

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

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