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
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
-
-