Record Class EntitySelectMenuDefinition

java.lang.Object
java.lang.Record
io.github.kaktushose.jdac.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
uniqueId - the uniqueId of this menu
All Implemented Interfaces:
Definition, CustomIdJDAEntity<net.dv8tion.jda.api.components.selections.EntitySelectMenu>, Invokable, JDAEntity<net.dv8tion.jda.api.components.selections.EntitySelectMenu>, ComponentDefinition<net.dv8tion.jda.api.components.selections.EntitySelectMenu>, SelectMenuDefinition<net.dv8tion.jda.api.components.selections.EntitySelectMenu>, InteractionDefinition

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

    • EntitySelectMenuDefinition

      public EntitySelectMenuDefinition(ClassDescription classDescription, MethodDescription methodDescription, Collection<String> permissions, Set<net.dv8tion.jda.api.components.selections.EntitySelectMenu.SelectTarget> selectTargets, Set<net.dv8tion.jda.api.components.selections.EntitySelectMenu.DefaultValue> defaultValues, Set<net.dv8tion.jda.api.entities.channel.ChannelType> channelTypes, String placeholder, int minValue, int maxValue, @Nullable Integer uniqueId)
      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
      uniqueId - the value for the uniqueId record component
  • Method Details

    • build

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

      public EntitySelectMenuDefinition with(@Nullable Set<net.dv8tion.jda.api.components.selections.EntitySelectMenu.SelectTarget> selectTargets, @Nullable Set<net.dv8tion.jda.api.components.selections.EntitySelectMenu.DefaultValue> defaultValues, @Nullable Set<net.dv8tion.jda.api.entities.channel.ChannelType> channelTypes, @Nullable String placeholder, @Nullable Integer minValue, @Nullable Integer maxValue, @Nullable Integer uniqueId)
      Builds a new EntitySelectMenuDefinition with the given values.
    • toJDAEntity

      public net.dv8tion.jda.api.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.components.selections.EntitySelectMenu>
      Returns:
      the EntitySelectMenu
      See Also:
    • toJDAEntity

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

      public 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

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

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

      public 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

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

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

      public 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

      public String placeholder()
      Returns the value of the placeholder record component.
      Specified by:
      placeholder in interface SelectMenuDefinition<net.dv8tion.jda.api.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.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.components.selections.EntitySelectMenu>
      Returns:
      the value of the maxValue record component
    • uniqueId

      public @Nullable Integer uniqueId()
      Returns the value of the uniqueId record component.
      Specified by:
      uniqueId in interface ComponentDefinition<net.dv8tion.jda.api.components.selections.EntitySelectMenu>
      Returns:
      the value of the uniqueId record component