Record Class EntitySelectMenuDefinition

java.lang.Object
java.lang.Record
com.github.kaktushose.jda.commands.definitions.interactions.component.menu.EntitySelectMenuDefinition
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
selectTargets - the EntitySelectMenu.SelectTargets of this menu
defaultValues - the EntitySelectMenu.DefaultValues of this menu
channelTypes - the ChannelTypes that should be supported by 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.EntitySelectMenu>, Invokable, JDAEntity<net.dv8tion.jda.api.interactions.components.selections.EntitySelectMenu>, ComponentDefinition<net.dv8tion.jda.api.interactions.components.selections.EntitySelectMenu>, SelectMenuDefinition<net.dv8tion.jda.api.interactions.components.selections.EntitySelectMenu>, InteractionDefinition

public record EntitySelectMenuDefinition(@NotNull ClassDescription classDescription, @NotNull MethodDescription methodDescription, @NotNull Collection<String> permissions, @NotNull Set<net.dv8tion.jda.api.interactions.components.selections.EntitySelectMenu.SelectTarget> selectTargets, @NotNull Set<net.dv8tion.jda.api.interactions.components.selections.EntitySelectMenu.DefaultValue> defaultValues, @NotNull Set<net.dv8tion.jda.api.entities.channel.ChannelType> channelTypes, @NotNull String placeholder, int minValue, int maxValue) extends Record implements SelectMenuDefinition<net.dv8tion.jda.api.interactions.components.selections.EntitySelectMenu>
Representation of an entity select menu.
  • Constructor Details

    • EntitySelectMenuDefinition

      public EntitySelectMenuDefinition(@NotNull @NotNull ClassDescription classDescription, @NotNull @NotNull MethodDescription methodDescription, @NotNull @NotNull Collection<String> permissions, @NotNull @NotNull Set<net.dv8tion.jda.api.interactions.components.selections.EntitySelectMenu.SelectTarget> selectTargets, @NotNull @NotNull Set<net.dv8tion.jda.api.interactions.components.selections.EntitySelectMenu.DefaultValue> defaultValues, @NotNull @NotNull Set<net.dv8tion.jda.api.entities.channel.ChannelType> channelTypes, @NotNull @NotNull String placeholder, int minValue, int maxValue)
      Creates an instance of a EntitySelectMenuDefinition record class.
      Parameters:
      classDescription - the value for the classDescription record component
      methodDescription - the value for the methodDescription record component
      permissions - the value for the permissions record component
      selectTargets - the value for the selectTargets record component
      defaultValues - the value for the defaultValues record component
      channelTypes - the value for the channelTypes record component
      placeholder - the value for the placeholder record component
      minValue - the value for the minValue record component
      maxValue - the value for the maxValue record component
  • Method Details

    • build

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

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

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

      @NotNull public @NotNull Set<net.dv8tion.jda.api.interactions.components.selections.EntitySelectMenu.SelectTarget> selectTargets()
      Returns the value of the selectTargets record component.
      Returns:
      the value of the selectTargets record component
    • defaultValues

      @NotNull public @NotNull Set<net.dv8tion.jda.api.interactions.components.selections.EntitySelectMenu.DefaultValue> defaultValues()
      Returns the value of the defaultValues record component.
      Returns:
      the value of the defaultValues record component
    • channelTypes

      @NotNull public @NotNull Set<net.dv8tion.jda.api.entities.channel.ChannelType> channelTypes()
      Returns the value of the channelTypes record component.
      Returns:
      the value of the channelTypes 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.EntitySelectMenu>
      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.EntitySelectMenu>
      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.EntitySelectMenu>
      Returns:
      the value of the maxValue record component