Package net.dv8tion.jda.api.events
Interface UpdateEvent<E,T>
-
- Type Parameters:
E- The entity typeT- The value type
- All Superinterfaces:
GenericEvent
- All Known Subinterfaces:
GuildVoiceUpdateEvent
- All Known Implementing Classes:
CategoryUpdateNameEvent,CategoryUpdatePositionEvent,EmoteUpdateNameEvent,EmoteUpdateRolesEvent,GenericCategoryUpdateEvent,GenericEmoteUpdateEvent,GenericGuildMemberUpdateEvent,GenericGuildUpdateEvent,GenericRoleUpdateEvent,GenericSelfUpdateEvent,GenericStoreChannelUpdateEvent,GenericTextChannelUpdateEvent,GenericUserUpdateEvent,GenericVoiceChannelUpdateEvent,GuildMemberUpdateNicknameEvent,GuildUpdateAfkChannelEvent,GuildUpdateAfkTimeoutEvent,GuildUpdateExplicitContentLevelEvent,GuildUpdateFeaturesEvent,GuildUpdateIconEvent,GuildUpdateMFALevelEvent,GuildUpdateNameEvent,GuildUpdateNotificationLevelEvent,GuildUpdateOwnerEvent,GuildUpdateRegionEvent,GuildUpdateSplashEvent,GuildUpdateSystemChannelEvent,GuildUpdateVerificationLevelEvent,GuildVoiceJoinEvent,GuildVoiceLeaveEvent,GuildVoiceMoveEvent,RoleUpdateColorEvent,RoleUpdateHoistedEvent,RoleUpdateMentionableEvent,RoleUpdateNameEvent,RoleUpdatePermissionsEvent,RoleUpdatePositionEvent,SelfUpdateAvatarEvent,SelfUpdateDiscriminatorEvent,SelfUpdateEmailEvent,SelfUpdateMFAEvent,SelfUpdateMobileEvent,SelfUpdateNameEvent,SelfUpdateNitroEvent,SelfUpdatePhoneNumberEvent,SelfUpdateVerifiedEvent,StatusChangeEvent,StoreChannelUpdateNameEvent,StoreChannelUpdatePositionEvent,TextChannelUpdateNameEvent,TextChannelUpdateNSFWEvent,TextChannelUpdateParentEvent,TextChannelUpdatePositionEvent,TextChannelUpdateSlowmodeEvent,TextChannelUpdateTopicEvent,UserUpdateActivityOrderEvent,UserUpdateAvatarEvent,UserUpdateDiscriminatorEvent,UserUpdateNameEvent,UserUpdateOnlineStatusEvent,VoiceChannelUpdateBitrateEvent,VoiceChannelUpdateNameEvent,VoiceChannelUpdateParentEvent,VoiceChannelUpdatePositionEvent,VoiceChannelUpdateUserLimitEvent
public interface UpdateEvent<E,T> extends GenericEvent
Indicates that a value of an entity was updated
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description EgetEntity()The affected entitydefault Class<E>getEntityType()Class representation of the affected entity, useful when dealing with refection.TgetNewValue()The new valueTgetOldValue()The old valueStringgetPropertyIdentifier()The field name for the updated property-
Methods inherited from interface net.dv8tion.jda.api.events.GenericEvent
getJDA, getResponseNumber
-
-
-
-
Method Detail
-
getEntityType
@Nonnull default Class<E> getEntityType()
Class representation of the affected entity, useful when dealing with refection.- Returns:
- The class of the affected entity
-
getPropertyIdentifier
@Nonnull String getPropertyIdentifier()
The field name for the updated propertyExample
@Override public void onGenericRoleUpdate(GenericRoleUpdateEvent event) { switch (event.getPropertyIdentifier()) { case RoleUpdateColorEvent.IDENTIFIER: System.out.printf("Updated color for role: %s%n", event); break; case RoleUpdatePositionEvent.IDENTIFIER: RoleUpdatePositionEvent update = (RoleUpdatePositionEvent) event; System.out.printf("Updated position for role: %s raw(%s->%s)%n", event, update.getOldPositionRaw(), update.getNewPositionRaw()); break; default: return; } }- Returns:
- The name of the updated property
-
-