Record Class EntitySelectMenuDefinition
java.lang.Object
java.lang.Record
io.github.kaktushose.jdac.definitions.interactions.component.menu.EntitySelectMenuDefinition
- Record Components:
classDescription- theClassDescriptionof the declaring class of themethodDescription()methodDescription- theMethodDescriptionof the method this definition is bound topermissions- aCollectionof permissions for this menuselectTargets- theEntitySelectMenu.SelectTargets of this menudefaultValues- theEntitySelectMenu.DefaultValues of this menuchannelTypes- theChannelTypes that should be supported by this menu.placeholder- the placeholder text of this menuminValue- the minimum amount of choicesmaxValue- the maximum amount of choicesuniqueId- the uniqueId of this menu
- All Implemented Interfaces:
Definition, CustomIdJDAEntity<EntitySelectMenu>, Invokable, JDAEntity<EntitySelectMenu>, ComponentDefinition<EntitySelectMenu>, SelectMenuDefinition<EntitySelectMenu>, InteractionDefinition
public record EntitySelectMenuDefinition(ClassDescription classDescription, MethodDescription methodDescription, Collection<String> permissions, Set<EntitySelectMenu.SelectTarget> selectTargets, Set<EntitySelectMenu.DefaultValue> defaultValues, Set<ChannelType> channelTypes, String placeholder, int minValue, int maxValue, @Nullable Integer uniqueId)
extends Record
implements SelectMenuDefinition<EntitySelectMenu>
Representation of an entity select menu.
-
Nested Class Summary
Nested classes/interfaces inherited from interface InteractionDefinition
InteractionDefinition.ReplyConfig -
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionEntitySelectMenuDefinition(ClassDescription classDescription, MethodDescription methodDescription, Collection<String> permissions, Set<EntitySelectMenu.SelectTarget> selectTargets, Set<EntitySelectMenu.DefaultValue> defaultValues, Set<ChannelType> channelTypes, String placeholder, int minValue, int maxValue, @Nullable Integer uniqueId) Creates an instance of aEntitySelectMenuDefinitionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic EntitySelectMenuDefinitionbuild(MethodBuildContext context) Builds a newEntitySelectMenuDefinitionfrom the givenMethodBuildContext.Returns the value of thechannelTypesrecord component.Returns the value of theclassDescriptionrecord component.Returns the value of thedefaultValuesrecord component.The human-readable name of this definition.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intmaxValue()Returns the value of themaxValuerecord component.Returns the value of themethodDescriptionrecord component.intminValue()Returns the value of theminValuerecord component.Returns the value of thepermissionsrecord component.Returns the value of theplaceholderrecord component.Returns the value of theselectTargetsrecord component.Transforms this definition to anEntitySelectMenuwith an independent custom id.toJDAEntity(CustomId customId) Transforms this definition to anEntitySelectMenuwith the givenCustomId.final StringtoString()Returns a string representation of this record class.@Nullable IntegeruniqueId()Returns the value of theuniqueIdrecord component.with(@Nullable Set<EntitySelectMenu.SelectTarget> selectTargets, @Nullable Set<EntitySelectMenu.DefaultValue> defaultValues, @Nullable Set<ChannelType> channelTypes, @Nullable String placeholder, @Nullable Integer minValue, @Nullable Integer maxValue, @Nullable Integer uniqueId) Builds a newEntitySelectMenuDefinitionwith the given values.Methods inherited from interface InteractionDefinition
definitionId
-
Constructor Details
-
EntitySelectMenuDefinition
public EntitySelectMenuDefinition(ClassDescription classDescription, MethodDescription methodDescription, Collection<String> permissions, Set<EntitySelectMenu.SelectTarget> selectTargets, Set<EntitySelectMenu.DefaultValue> defaultValues, Set<ChannelType> channelTypes, String placeholder, int minValue, int maxValue, @Nullable Integer uniqueId) Creates an instance of aEntitySelectMenuDefinitionrecord class.- Parameters:
classDescription- the value for theclassDescriptionrecord componentmethodDescription- the value for themethodDescriptionrecord componentpermissions- the value for thepermissionsrecord componentselectTargets- the value for theselectTargetsrecord componentdefaultValues- the value for thedefaultValuesrecord componentchannelTypes- the value for thechannelTypesrecord componentplaceholder- the value for theplaceholderrecord componentminValue- the value for theminValuerecord componentmaxValue- the value for themaxValuerecord componentuniqueId- the value for theuniqueIdrecord component
-
-
Method Details
-
build
Builds a newEntitySelectMenuDefinitionfrom the givenMethodBuildContext.- Returns:
- an
Optionalholding theEntitySelectMenuDefinition
-
with
public EntitySelectMenuDefinition with(@Nullable Set<EntitySelectMenu.SelectTarget> selectTargets, @Nullable Set<EntitySelectMenu.DefaultValue> defaultValues, @Nullable Set<ChannelType> channelTypes, @Nullable String placeholder, @Nullable Integer minValue, @Nullable Integer maxValue, @Nullable Integer uniqueId) Builds a newEntitySelectMenuDefinitionwith the given values. -
toJDAEntity
Transforms this definition to anEntitySelectMenuwith an independent custom id.- Specified by:
toJDAEntityin interfaceJDAEntity<EntitySelectMenu>- Returns:
- the
EntitySelectMenu - See Also:
-
toJDAEntity
Transforms this definition to anEntitySelectMenuwith the givenCustomId.- Specified by:
toJDAEntityin interfaceCustomIdJDAEntity<EntitySelectMenu>- Parameters:
customId- theCustomIdto use- Returns:
- the
EntitySelectMenu
-
displayName
Description copied from interface:DefinitionThe human-readable name of this definition.- Specified by:
displayNamein 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 thecomparemethod from their corresponding wrapper classes. -
classDescription
Returns the value of theclassDescriptionrecord component.- Specified by:
classDescriptionin interfaceComponentDefinition<EntitySelectMenu>- Specified by:
classDescriptionin interfaceInvokable- Returns:
- the value of the
classDescriptionrecord component
-
methodDescription
Returns the value of themethodDescriptionrecord component.- Specified by:
methodDescriptionin interfaceComponentDefinition<EntitySelectMenu>- Specified by:
methodDescriptionin interfaceInvokable- Returns:
- the value of the
methodDescriptionrecord component
-
permissions
Returns the value of thepermissionsrecord component.- Specified by:
permissionsin interfaceInteractionDefinition- Returns:
- the value of the
permissionsrecord component
-
selectTargets
Returns the value of theselectTargetsrecord component.- Returns:
- the value of the
selectTargetsrecord component
-
defaultValues
Returns the value of thedefaultValuesrecord component.- Returns:
- the value of the
defaultValuesrecord component
-
channelTypes
Returns the value of thechannelTypesrecord component.- Returns:
- the value of the
channelTypesrecord component
-
placeholder
Returns the value of theplaceholderrecord component.- Specified by:
placeholderin interfaceSelectMenuDefinition<EntitySelectMenu>- Returns:
- the value of the
placeholderrecord component
-
minValue
public int minValue()Returns the value of theminValuerecord component.- Specified by:
minValuein interfaceSelectMenuDefinition<EntitySelectMenu>- Returns:
- the value of the
minValuerecord component
-
maxValue
public int maxValue()Returns the value of themaxValuerecord component.- Specified by:
maxValuein interfaceSelectMenuDefinition<EntitySelectMenu>- Returns:
- the value of the
maxValuerecord component
-
uniqueId
Returns the value of theuniqueIdrecord component.- Specified by:
uniqueIdin interfaceComponentDefinition<EntitySelectMenu>- Returns:
- the value of the
uniqueIdrecord component
-