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:
-
Nested Class Summary
Nested classes/interfaces inherited from interface InteractionDefinition
InteractionDefinition.ReplyConfig -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionTheClassDescriptionof the declaring class of themethodDescription()TheMethodDescriptionof the method this definition is bound tostatic <T> @Nullable Toverride(@Nullable T oldValue, @Nullable T newValue) Overrides the oldValue with the newValue if present, else returns the oldValuestatic <E, T extends Collection<E>>
TIf present adds the newValues to the collection provided by the supplier, else returns the oldValue.@Nullable IntegeruniqueId()The uniqueId of this component.Methods inherited from interface CustomIdJDAEntity
toJDAEntityMethods inherited from interface Definition
displayNameMethods inherited from interface InteractionDefinition
definitionId, permissionsMethods inherited from interface JDAEntity
toJDAEntity
-
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 collectionT- the type of the collection- Returns:
- if present the newValue, else the oldValue
-
classDescription
ClassDescription classDescription()TheClassDescriptionof the declaring class of themethodDescription()- Specified by:
classDescriptionin interfaceInvokable
-
methodDescription
MethodDescription methodDescription()TheMethodDescriptionof the method this definition is bound to- Specified by:
methodDescriptionin interfaceInvokable
-
uniqueId
@Nullable Integer uniqueId()The uniqueId of this component. Ifnull, Discord will assign an id.
-