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:
ChannelUpdateArchivedEvent
,ChannelUpdateArchiveTimestampEvent
,ChannelUpdateAutoArchiveDurationEvent
,ChannelUpdateBitrateEvent
,ChannelUpdateInvitableEvent
,ChannelUpdateLockedEvent
,ChannelUpdateNameEvent
,ChannelUpdateNSFWEvent
,ChannelUpdateParentEvent
,ChannelUpdatePositionEvent
,ChannelUpdateRegionEvent
,ChannelUpdateSlowmodeEvent
,ChannelUpdateTopicEvent
,ChannelUpdateTypeEvent
,ChannelUpdateUserLimitEvent
,EmoteUpdateNameEvent
,EmoteUpdateRolesEvent
,GatewayPingEvent
,GenericChannelUpdateEvent
,GenericEmoteUpdateEvent
,GenericGuildMemberUpdateEvent
,GenericGuildUpdateEvent
,GenericGuildVoiceUpdateEvent
,GenericRoleUpdateEvent
,GenericSelfUpdateEvent
,GenericStageInstanceUpdateEvent
,GenericUserUpdateEvent
,GuildMemberUpdateAvatarEvent
,GuildMemberUpdateBoostTimeEvent
,GuildMemberUpdateNicknameEvent
,GuildMemberUpdatePendingEvent
,GuildMemberUpdateTimeOutEvent
,GuildUpdateAfkChannelEvent
,GuildUpdateAfkTimeoutEvent
,GuildUpdateBannerEvent
,GuildUpdateBoostCountEvent
,GuildUpdateBoostTierEvent
,GuildUpdateCommunityUpdatesChannelEvent
,GuildUpdateDescriptionEvent
,GuildUpdateExplicitContentLevelEvent
,GuildUpdateFeaturesEvent
,GuildUpdateIconEvent
,GuildUpdateLocaleEvent
,GuildUpdateMaxMembersEvent
,GuildUpdateMaxPresencesEvent
,GuildUpdateMFALevelEvent
,GuildUpdateNameEvent
,GuildUpdateNotificationLevelEvent
,GuildUpdateNSFWLevelEvent
,GuildUpdateOwnerEvent
,GuildUpdateRulesChannelEvent
,GuildUpdateSplashEvent
,GuildUpdateSystemChannelEvent
,GuildUpdateVanityCodeEvent
,GuildUpdateVerificationLevelEvent
,GuildVoiceJoinEvent
,GuildVoiceLeaveEvent
,GuildVoiceMoveEvent
,RoleUpdateColorEvent
,RoleUpdateHoistedEvent
,RoleUpdateIconEvent
,RoleUpdateMentionableEvent
,RoleUpdateNameEvent
,RoleUpdatePermissionsEvent
,RoleUpdatePositionEvent
,SelfUpdateAvatarEvent
,SelfUpdateDiscriminatorEvent
,SelfUpdateMFAEvent
,SelfUpdateNameEvent
,SelfUpdateVerifiedEvent
,StageInstanceUpdatePrivacyLevelEvent
,StageInstanceUpdateTopicEvent
,StatusChangeEvent
,UserUpdateActivitiesEvent
,UserUpdateActivityOrderEvent
,UserUpdateAvatarEvent
,UserUpdateDiscriminatorEvent
,UserUpdateFlagsEvent
,UserUpdateNameEvent
,UserUpdateOnlineStatusEvent
Indicates that a value of an entity was updated
-
Method Summary
Modifier and TypeMethodDescriptionThe affected entityClass representation of the affected entity, useful when dealing with refection.The new valueThe old valueThe field name for the updated propertyMethods inherited from interface net.dv8tion.jda.api.events.GenericEvent
getJDA, getResponseNumber
-
Method Details
-
getEntityType
Class representation of the affected entity, useful when dealing with refection.- Returns:
- The class of the affected entity
-
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
-
getEntity
The affected entity- Returns:
- The affected entity
-
getOldValue
The old value- Returns:
- The old value
-
getNewValue
The new value- Returns:
- The new value
-