Record Class ModalDefinition
java.lang.Object
java.lang.Record
com.github.kaktushose.jda.commands.definitions.interactions.ModalDefinition
- 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 modaltitle
- the title of the modaltextInputs
- theTextInputs
of this modal
- All Implemented Interfaces:
Definition
,CustomIdJDAEntity<Modal>
,com.github.kaktushose.jda.commands.definitions.features.internal.Invokable
,InteractionDefinition
public record ModalDefinition(@NotNull ClassDescription clazzDescription, @NotNull MethodDescription methodDescription, @NotNull Collection<String> permissions, @NotNull String title, @NotNull SequencedCollection<ModalDefinition.TextInputDefinition> textInputs)
extends Record
implements InteractionDefinition, CustomIdJDAEntity<Modal>
Representation of a modal.
-
Nested Class Summary
Modifier 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
Fields inherited from interface com.github.kaktushose.jda.commands.definitions.features.internal.Invokable
log
-
Constructor Summary
ConstructorDescriptionModalDefinition
(@NotNull ClassDescription clazzDescription, @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 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.@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 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
Methods inherited from interface com.github.kaktushose.jda.commands.definitions.features.internal.Invokable
invoke
-
Constructor Details
-
ModalDefinition
public ModalDefinition(@NotNull @NotNull ClassDescription clazzDescription, @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:
clazzDescription
- the value for theclazzDescription
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
Transforms this definition to anModal
with the given custom id.- Specified by:
toJDAEntity
in interfaceCustomIdJDAEntity<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)
. -
clazzDescription
Returns the value of theclazzDescription
record component.- 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 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
-
title
-
textInputs
Returns the value of thetextInputs
record component.- Returns:
- the value of the
textInputs
record component
-