Record Class StringSelectMenuDefinition

java.lang.Object
java.lang.Record
com.github.kaktushose.jda.commands.definitions.interactions.component.menu.StringSelectMenuDefinition
Record Components:
classDescription - the ClassDescription of the declaring class of the methodDescription()
methodDescription - the MethodDescription of the method this definition is bound to
permissions - a Collection of permissions for this menu
selectOptions - the SelectOptions of this menu
placeholder - the placeholder text of this menu
minValue - the minimum amount of choices
maxValue - the maximum amount of choices
All Implemented Interfaces:
Definition, CustomIdJDAEntity<net.dv8tion.jda.api.interactions.components.selections.StringSelectMenu>, Invokable, JDAEntity<net.dv8tion.jda.api.interactions.components.selections.StringSelectMenu>, ComponentDefinition<net.dv8tion.jda.api.interactions.components.selections.StringSelectMenu>, SelectMenuDefinition<net.dv8tion.jda.api.interactions.components.selections.StringSelectMenu>, InteractionDefinition

public record StringSelectMenuDefinition(@NotNull ClassDescription classDescription, @NotNull MethodDescription methodDescription, @NotNull Collection<String> permissions, @NotNull Set<StringSelectMenuDefinition.SelectOptionDefinition> selectOptions, @NotNull String placeholder, int minValue, int maxValue) extends Record implements SelectMenuDefinition<net.dv8tion.jda.api.interactions.components.selections.StringSelectMenu>
Representation of a string select menu.
  • Constructor Details

  • Method Details

    • build

      public static Optional<StringSelectMenuDefinition> build(MethodBuildContext context)
      Builds a new StringSelectMenuDefinition from the given MethodBuildContext.
      Returns:
      an Optional holding the StringSelectMenuDefinition
    • toJDAEntity

      @NotNull public @NotNull net.dv8tion.jda.api.interactions.components.selections.StringSelectMenu toJDAEntity()
      Transforms this definition to an StringSelectMenu with an independent custom id.
      Specified by:
      toJDAEntity in interface JDAEntity<net.dv8tion.jda.api.interactions.components.selections.StringSelectMenu>
      Returns:
      the StringSelectMenu
      See Also:
    • toJDAEntity

      @NotNull public @NotNull net.dv8tion.jda.api.interactions.components.selections.StringSelectMenu toJDAEntity(@NotNull @NotNull CustomId customId)
      Transforms this definition to an StringSelectMenu with the given CustomId.
      Specified by:
      toJDAEntity in interface CustomIdJDAEntity<net.dv8tion.jda.api.interactions.components.selections.StringSelectMenu>
      Parameters:
      customId - the CustomId to use
      Returns:
      the StringSelectMenu
    • displayName

      @NotNull public @NotNull String displayName()
      Description copied from interface: Definition
      The human-readable name of this definition.
      Specified by:
      displayName in interface Definition
    • 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.
    • classDescription

      @NotNull public @NotNull ClassDescription classDescription()
      Returns the value of the classDescription record component.
      Specified by:
      classDescription in interface ComponentDefinition<net.dv8tion.jda.api.interactions.components.selections.StringSelectMenu>
      Specified by:
      classDescription in interface Invokable
      Returns:
      the value of the classDescription record component
    • methodDescription

      @NotNull public @NotNull MethodDescription methodDescription()
      Returns the value of the methodDescription record component.
      Specified by:
      methodDescription in interface ComponentDefinition<net.dv8tion.jda.api.interactions.components.selections.StringSelectMenu>
      Specified by:
      methodDescription in interface Invokable
      Returns:
      the value of the methodDescription record component
    • permissions

      @NotNull public @NotNull Collection<String> permissions()
      Returns the value of the permissions record component.
      Specified by:
      permissions in interface InteractionDefinition
      Returns:
      the value of the permissions record component
    • selectOptions

      @NotNull public @NotNull Set<StringSelectMenuDefinition.SelectOptionDefinition> selectOptions()
      Returns the value of the selectOptions record component.
      Returns:
      the value of the selectOptions record component
    • placeholder

      @NotNull public @NotNull String placeholder()
      Returns the value of the placeholder record component.
      Specified by:
      placeholder in interface SelectMenuDefinition<net.dv8tion.jda.api.interactions.components.selections.StringSelectMenu>
      Returns:
      the value of the placeholder record component
    • minValue

      public int minValue()
      Returns the value of the minValue record component.
      Specified by:
      minValue in interface SelectMenuDefinition<net.dv8tion.jda.api.interactions.components.selections.StringSelectMenu>
      Returns:
      the value of the minValue record component
    • maxValue

      public int maxValue()
      Returns the value of the maxValue record component.
      Specified by:
      maxValue in interface SelectMenuDefinition<net.dv8tion.jda.api.interactions.components.selections.StringSelectMenu>
      Returns:
      the value of the maxValue record component