Record Class ModalDefinition

java.lang.Object
java.lang.Record
com.github.kaktushose.jda.commands.definitions.interactions.ModalDefinition
Record Components:
clazzDescription - 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 modal
title - the title of the modal
textInputs - the TextInputs 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.
  • Constructor Details

  • Method Details

    • build

      public static Optional<ModalDefinition> build(MethodBuildContext context)
      Builds a new ModalDefinition from the given MethodBuildContext.
      Returns:
      an Optional holding the ModalDefinition
    • toJDAEntity

      @NotNull public @NotNull Modal toJDAEntity(@NotNull @NotNull CustomId customId)
      Transforms this definition to an Modal with the given custom id.
      Specified by:
      toJDAEntity in interface CustomIdJDAEntity<Modal>
      Parameters:
      customId - the CustomId to use to build this JDA entity
      Returns:
      the Modal
      See Also:
    • displayName

      @NotNull public @NotNull 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • clazzDescription

      @NotNull public @NotNull ClassDescription clazzDescription()
      Returns the value of the clazzDescription record component.
      Specified by:
      clazzDescription in interface com.github.kaktushose.jda.commands.definitions.features.internal.Invokable
      Returns:
      the value of the clazzDescription record component
    • methodDescription

      @NotNull public @NotNull MethodDescription methodDescription()
      Returns the value of the methodDescription record component.
      Specified by:
      methodDescription in interface com.github.kaktushose.jda.commands.definitions.features.internal.Invokable
      Returns:
      the value of the methodDescription record component
    • permissions

      @NotNull public @NotNull 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
    • title

      @NotNull public @NotNull String title()
      Returns the value of the title record component.
      Returns:
      the value of the title record component
    • textInputs

      @NotNull public @NotNull SequencedCollection<ModalDefinition.TextInputDefinition> textInputs()
      Returns the value of the textInputs record component.
      Returns:
      the value of the textInputs record component