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,GatewayPingEvent,GenericCategoryUpdateEvent,GenericEmoteUpdateEvent,GenericGuildMemberUpdateEvent,GenericGuildUpdateEvent,GenericGuildVoiceUpdateEvent,GenericRoleUpdateEvent,GenericSelfUpdateEvent,GenericStageInstanceUpdateEvent,GenericStoreChannelUpdateEvent,GenericTextChannelUpdateEvent,GenericUserUpdateEvent,GenericVoiceChannelUpdateEvent,GuildMemberUpdateAvatarEvent,GuildMemberUpdateBoostTimeEvent,GuildMemberUpdateNicknameEvent,GuildMemberUpdatePendingEvent,GuildUpdateAfkChannelEvent,GuildUpdateAfkTimeoutEvent,GuildUpdateBannerEvent,GuildUpdateBoostCountEvent,GuildUpdateBoostTierEvent,GuildUpdateCommunityUpdatesChannelEvent,GuildUpdateDescriptionEvent,GuildUpdateExplicitContentLevelEvent,GuildUpdateFeaturesEvent,GuildUpdateIconEvent,GuildUpdateLocaleEvent,GuildUpdateMaxMembersEvent,GuildUpdateMaxPresencesEvent,GuildUpdateMFALevelEvent,GuildUpdateNameEvent,GuildUpdateNotificationLevelEvent,GuildUpdateNSFWLevelEvent,GuildUpdateOwnerEvent,GuildUpdateRegionEvent,GuildUpdateRulesChannelEvent,GuildUpdateSplashEvent,GuildUpdateSystemChannelEvent,GuildUpdateVanityCodeEvent,GuildUpdateVerificationLevelEvent,GuildVoiceJoinEvent,GuildVoiceLeaveEvent,GuildVoiceMoveEvent,RoleUpdateColorEvent,RoleUpdateHoistedEvent,RoleUpdateIconEvent,RoleUpdateMentionableEvent,RoleUpdateNameEvent,RoleUpdatePermissionsEvent,RoleUpdatePositionEvent,SelfUpdateAvatarEvent,SelfUpdateDiscriminatorEvent,SelfUpdateMFAEvent,SelfUpdateNameEvent,SelfUpdateVerifiedEvent,StageInstanceUpdatePrivacyLevelEvent,StageInstanceUpdateTopicEvent,StatusChangeEvent,StoreChannelUpdateNameEvent,StoreChannelUpdatePositionEvent,TextChannelUpdateNameEvent,TextChannelUpdateNewsEvent,TextChannelUpdateNSFWEvent,TextChannelUpdateParentEvent,TextChannelUpdatePositionEvent,TextChannelUpdateSlowmodeEvent,TextChannelUpdateTopicEvent,UserUpdateActivitiesEvent,UserUpdateActivityOrderEvent,UserUpdateAvatarEvent,UserUpdateDiscriminatorEvent,UserUpdateFlagsEvent,UserUpdateNameEvent,UserUpdateOnlineStatusEvent,VoiceChannelUpdateBitrateEvent,VoiceChannelUpdateNameEvent,VoiceChannelUpdateParentEvent,VoiceChannelUpdatePositionEvent,VoiceChannelUpdateRegionEvent,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 java.lang.Class<E>getEntityType()Class representation of the affected entity, useful when dealing with refection.TgetNewValue()The new valueTgetOldValue()The old valuejava.lang.StringgetPropertyIdentifier()The field name for the updated property-
Methods inherited from interface net.dv8tion.jda.api.events.GenericEvent
getJDA, getResponseNumber
-
-
-
-
Method Detail
-
getEntityType
@Nonnull default java.lang.Class<E> getEntityType()
Class representation of the affected entity, useful when dealing with refection.- Returns:
- The class of the affected entity
-
getPropertyIdentifier
@Nonnull java.lang.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
-
getEntity
@Nonnull E getEntity()
The affected entity- Returns:
- The affected entity
-
getOldValue
@Nullable T getOldValue()
The old value- Returns:
- The old value
-
getNewValue
@Nullable T getNewValue()
The new value- Returns:
- The new value
-
-