Record Class StringSelectMenuDefinition
java.lang.Object
java.lang.Record
com.github.kaktushose.jda.commands.definitions.interactions.component.menu.StringSelectMenuDefinition
- Record Components:
clazzDescription
- theClassDescription
of the declaring class of themethodDescription()
methodDescription
- theMethodDescription
of the method this definition is bound topermissions
- aCollection
of permissions for this menuselectOptions
- the SelectOptions of this menuplaceholder
- the placeholder text of this menuminValue
- the minimum amount of choicesmaxValue
- the maximum amount of choices
- All Implemented Interfaces:
Definition
,CustomIdJDAEntity<StringSelectMenu>
,com.github.kaktushose.jda.commands.definitions.features.internal.Invokable
,JDAEntity<StringSelectMenu>
,ComponentDefinition<StringSelectMenu>
,SelectMenuDefinition<StringSelectMenu>
,InteractionDefinition
public record StringSelectMenuDefinition(@NotNull ClassDescription clazzDescription, @NotNull MethodDescription methodDescription, @NotNull Collection<String> permissions, @NotNull Set<StringSelectMenuDefinition.SelectOptionDefinition> selectOptions, @NotNull String placeholder, int minValue, int maxValue)
extends Record
implements SelectMenuDefinition<StringSelectMenu>
Representation of a string select menu.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final record
Representation of a select option for a string select menu defined by aSelectOption
.Nested classes/interfaces inherited from interface com.github.kaktushose.jda.commands.definitions.interactions.InteractionDefinition
InteractionDefinition.ReplyConfig
-
Field Summary
Fields inherited from interface com.github.kaktushose.jda.commands.definitions.features.internal.Invokable
log
-
Constructor Summary
ConstructorDescriptionStringSelectMenuDefinition
(@NotNull ClassDescription clazzDescription, @NotNull MethodDescription methodDescription, @NotNull Collection<String> permissions, @NotNull Set<StringSelectMenuDefinition.SelectOptionDefinition> selectOptions, @NotNull String placeholder, int minValue, int maxValue) Creates an instance of aStringSelectMenuDefinition
record class. -
Method Summary
Modifier and TypeMethodDescriptionstatic Optional
<StringSelectMenuDefinition> build
(MethodBuildContext context) Builds a newStringSelectMenuDefinition
from the givenMethodBuildContext
.@NotNull ClassDescription
Returns the value of theclazzDescription
record component.@NotNull String
The human-readable name of this definition.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.int
maxValue()
Returns the value of themaxValue
record component.@NotNull MethodDescription
Returns the value of themethodDescription
record component.int
minValue()
Returns the value of theminValue
record component.@NotNull Collection
<String> Returns the value of thepermissions
record component.@NotNull String
Returns the value of theplaceholder
record component.Returns the value of theselectOptions
record component.@NotNull StringSelectMenu
Transforms this definition to anStringSelectMenu
with an independent custom id.@NotNull StringSelectMenu
toJDAEntity
(@NotNull CustomId customId) Transforms this definition to anStringSelectMenu
with the givenCustomId
.final String
toString()
Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.github.kaktushose.jda.commands.definitions.interactions.InteractionDefinition
definitionId, newInstance, replyConfig
Methods inherited from interface com.github.kaktushose.jda.commands.definitions.features.internal.Invokable
invoke
-
Constructor Details
-
StringSelectMenuDefinition
public StringSelectMenuDefinition(@NotNull @NotNull ClassDescription clazzDescription, @NotNull @NotNull MethodDescription methodDescription, @NotNull @NotNull Collection<String> permissions, @NotNull @NotNull Set<StringSelectMenuDefinition.SelectOptionDefinition> selectOptions, @NotNull @NotNull String placeholder, int minValue, int maxValue) Creates an instance of aStringSelectMenuDefinition
record class.- Parameters:
clazzDescription
- the value for theclazzDescription
record componentmethodDescription
- the value for themethodDescription
record componentpermissions
- the value for thepermissions
record componentselectOptions
- the value for theselectOptions
record componentplaceholder
- the value for theplaceholder
record componentminValue
- the value for theminValue
record componentmaxValue
- the value for themaxValue
record component
-
-
Method Details
-
build
Builds a newStringSelectMenuDefinition
from the givenMethodBuildContext
.- Returns:
- an
Optional
holding theStringSelectMenuDefinition
-
toJDAEntity
Transforms this definition to anStringSelectMenu
with an independent custom id.- Specified by:
toJDAEntity
in interfaceJDAEntity<StringSelectMenu>
- Returns:
- the
StringSelectMenu
- See Also:
-
toJDAEntity
Transforms this definition to anStringSelectMenu
with the givenCustomId
.- Specified by:
toJDAEntity
in interfaceCustomIdJDAEntity<StringSelectMenu>
- Parameters:
customId
- theCustomId
to use- Returns:
- the
StringSelectMenu
-
displayName
Description copied from interface:Definition
The human-readable name of this definition.- Specified by:
displayName
in interfaceDefinition
-
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object)
; primitive components are compared with thecompare
method from their corresponding wrapper classes. -
clazzDescription
Returns the value of theclazzDescription
record component.- Specified by:
clazzDescription
in interfaceComponentDefinition<StringSelectMenu>
- Specified by:
clazzDescription
in interfacecom.github.kaktushose.jda.commands.definitions.features.internal.Invokable
- Returns:
- the value of the
clazzDescription
record component
-
methodDescription
Returns the value of themethodDescription
record component.- Specified by:
methodDescription
in interfaceComponentDefinition<StringSelectMenu>
- Specified by:
methodDescription
in interfacecom.github.kaktushose.jda.commands.definitions.features.internal.Invokable
- Returns:
- the value of the
methodDescription
record component
-
permissions
Returns the value of thepermissions
record component.- Specified by:
permissions
in interfaceInteractionDefinition
- Returns:
- the value of the
permissions
record component
-
selectOptions
Returns the value of theselectOptions
record component.- Returns:
- the value of the
selectOptions
record component
-
placeholder
Returns the value of theplaceholder
record component.- Specified by:
placeholder
in interfaceSelectMenuDefinition<StringSelectMenu>
- Returns:
- the value of the
placeholder
record component
-
minValue
public int minValue()Returns the value of theminValue
record component.- Specified by:
minValue
in interfaceSelectMenuDefinition<StringSelectMenu>
- Returns:
- the value of the
minValue
record component
-
maxValue
public int maxValue()Returns the value of themaxValue
record component.- Specified by:
maxValue
in interfaceSelectMenuDefinition<StringSelectMenu>
- Returns:
- the value of the
maxValue
record component
-