Record Class ModalDefinition
java.lang.Object
java.lang.Record
com.github.kaktushose.jda.commands.definitions.interactions.ModalDefinition
- Record Components:
classDescription
- theClassDescription
of the declaring class of themethodDescription()
methodDescription
- theMethodDescription
of the method this definition is bound topermissions
- aCollection
of permissions for this modaltitle
- the title of the modaltextInputs
- theTextInputs
of this modal
- All Implemented Interfaces:
Definition
,CustomIdJDAEntity<net.dv8tion.jda.api.interactions.modals.Modal>
,Invokable
,InteractionDefinition
public record ModalDefinition(@NotNull ClassDescription classDescription, @NotNull MethodDescription methodDescription, @NotNull Collection<String> permissions, @NotNull String title, @NotNull SequencedCollection<ModalDefinition.TextInputDefinition> textInputs)
extends Record
implements InteractionDefinition, CustomIdJDAEntity<net.dv8tion.jda.api.interactions.modals.Modal>
Representation of a modal.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final record
Representation of a modal text input defined byTextInput
Nested classes/interfaces inherited from interface com.github.kaktushose.jda.commands.definitions.interactions.InteractionDefinition
InteractionDefinition.ReplyConfig
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionModalDefinition
(@NotNull ClassDescription classDescription, @NotNull MethodDescription methodDescription, @NotNull Collection<String> permissions, @NotNull String title, @NotNull SequencedCollection<ModalDefinition.TextInputDefinition> textInputs) Creates an instance of aModalDefinition
record class. -
Method Summary
Modifier and TypeMethodDescriptionstatic Optional
<ModalDefinition> build
(MethodBuildContext context) Builds a newModalDefinition
from the givenMethodBuildContext
.@NotNull ClassDescription
Returns the value of theclassDescription
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.@NotNull MethodDescription
Returns the value of themethodDescription
record component.@NotNull Collection
<String> Returns the value of thepermissions
record component.Returns the value of thetextInputs
record component.@NotNull String
title()
Returns the value of thetitle
record component.@NotNull net.dv8tion.jda.api.interactions.modals.Modal
toJDAEntity
(@NotNull CustomId customId) Transforms this definition to anModal
with the given custom id.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
-
Constructor Details
-
ModalDefinition
public ModalDefinition(@NotNull @NotNull ClassDescription classDescription, @NotNull @NotNull MethodDescription methodDescription, @NotNull @NotNull Collection<String> permissions, @NotNull @NotNull String title, @NotNull @NotNull SequencedCollection<ModalDefinition.TextInputDefinition> textInputs) Creates an instance of aModalDefinition
record class.- Parameters:
classDescription
- the value for theclassDescription
record componentmethodDescription
- the value for themethodDescription
record componentpermissions
- the value for thepermissions
record componenttitle
- the value for thetitle
record componenttextInputs
- the value for thetextInputs
record component
-
-
Method Details
-
build
Builds a newModalDefinition
from the givenMethodBuildContext
.- Returns:
- an
Optional
holding theModalDefinition
-
toJDAEntity
@NotNull public @NotNull net.dv8tion.jda.api.interactions.modals.Modal toJDAEntity(@NotNull @NotNull CustomId customId) Transforms this definition to anModal
with the given custom id.- Specified by:
toJDAEntity
in interfaceCustomIdJDAEntity<net.dv8tion.jda.api.interactions.modals.Modal>
- Parameters:
customId
- theCustomId
to use to build this JDA entity- Returns:
- the
Modal
- See Also:
-
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. All components in this record class are compared withObjects::equals(Object,Object)
. -
classDescription
Returns the value of theclassDescription
record component.- Specified by:
classDescription
in interfaceInvokable
- Returns:
- the value of the
classDescription
record component
-
methodDescription
Returns the value of themethodDescription
record component.- Specified by:
methodDescription
in interfaceInvokable
- 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
-
title
-
textInputs
Returns the value of thetextInputs
record component.- Returns:
- the value of the
textInputs
record component
-