Record Class AutoCompleteDefinition

java.lang.Object
java.lang.Record
com.github.kaktushose.jda.commands.definitions.interactions.AutoCompleteDefinition
Record Components:
clazzDescription - the ClassDescription of the declaring class of the methodDescription()
methodDescription - the MethodDescription of the method this definition is bound to
commands - the commands this autocomplete handler can handle
All Implemented Interfaces:
Definition, com.github.kaktushose.jda.commands.definitions.features.internal.Invokable, InteractionDefinition

public record AutoCompleteDefinition(@NotNull ClassDescription clazzDescription, @NotNull MethodDescription methodDescription, @NotNull Set<String> commands) extends Record implements InteractionDefinition
Representation of an auto complete handler.
  • Constructor Details

    • AutoCompleteDefinition

      public AutoCompleteDefinition(@NotNull @NotNull ClassDescription clazzDescription, @NotNull @NotNull MethodDescription methodDescription, @NotNull @NotNull Set<String> commands)
      Creates an instance of a AutoCompleteDefinition record class.
      Parameters:
      clazzDescription - the value for the clazzDescription record component
      methodDescription - the value for the methodDescription record component
      commands - the value for the commands record component
  • Method Details

    • build

      @NotNull public static @NotNull Optional<AutoCompleteDefinition> build(@NotNull @NotNull ClassDescription clazz, @NotNull @NotNull MethodDescription method)
      Builds a new AutoCompleteDefinition from the given class and method description.
      Parameters:
      clazz - the corresponding ClassDescription
      method - the corresponding MethodDescription
      Returns:
      an Optional holding the AutoCompleteDefinition
    • displayName

      @NotNull public @NotNull String displayName()
      Description copied from interface: Definition
      The human-readable name of this definition.
      Specified by:
      displayName in interface Definition
    • permissions

      @NotNull public @NotNull Collection<String> permissions()
      Description copied from interface: InteractionDefinition
      A possibly-empty Collection of permissions for this interaction.
      Specified by:
      permissions in interface InteractionDefinition
    • 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
    • commands

      @NotNull public @NotNull Set<String> commands()
      Returns the value of the commands record component.
      Returns:
      the value of the commands record component