Interface ComponentDefinition<T>

All Superinterfaces:
CustomIdJDAEntity<T>, Definition, InteractionDefinition, Invokable, JDAEntity<T>
All Known Subinterfaces:
SelectMenuDefinition<T>
All Known Implementing Classes:
ButtonDefinition, EntitySelectMenuDefinition, StringSelectMenuDefinition

public sealed interface ComponentDefinition<T> extends InteractionDefinition, JDAEntity<T>, CustomIdJDAEntity<T> permits ButtonDefinition, SelectMenuDefinition<T>
Common interface for component interaction definitions.
See Also:
  • Method Details

    • override

      static <T> @Nullable T override(@Nullable T oldValue, @Nullable T newValue)
      Overrides the oldValue with the newValue if present, else returns the oldValue
      Type Parameters:
      T - the type of the value
      Returns:
      if present the newValue, else the oldValue
    • override

      static <E, T extends Collection<E>> T override(Supplier<T> newSupp, T oldValue, @Nullable T newValues)
      If present adds the newValues to the collection provided by the supplier, else returns the oldValue.
      Type Parameters:
      E - the type of elements in the collection
      T - the type of the collection
      Returns:
      if present the newValue, else the oldValue
    • classDescription

      ClassDescription classDescription()
      The ClassDescription of the declaring class of the methodDescription()
      Specified by:
      classDescription in interface Invokable
    • methodDescription

      MethodDescription methodDescription()
      The MethodDescription of the method this definition is bound to
      Specified by:
      methodDescription in interface Invokable
    • uniqueId

      @Nullable Integer uniqueId()
      The uniqueId of this component. If null, Discord will assign an id.