E
- The entity typeT
- The value typeCategoryUpdateNameEvent
, CategoryUpdatePositionEvent
, EmoteUpdateNameEvent
, EmoteUpdateRolesEvent
, GenericCategoryUpdateEvent
, GenericEmoteUpdateEvent
, GenericGuildUpdateEvent
, GenericRoleUpdateEvent
, GenericSelfUpdateEvent
, GenericTextChannelUpdateEvent
, GenericUserPresenceEvent
, GenericUserUpdateEvent
, GenericVoiceChannelUpdateEvent
, GuildUpdateAfkChannelEvent
, GuildUpdateAfkTimeoutEvent
, GuildUpdateExplicitContentLevelEvent
, GuildUpdateFeaturesEvent
, GuildUpdateIconEvent
, GuildUpdateMFALevelEvent
, GuildUpdateNameEvent
, GuildUpdateNotificationLevelEvent
, GuildUpdateOwnerEvent
, GuildUpdateRegionEvent
, GuildUpdateSplashEvent
, GuildUpdateSystemChannelEvent
, GuildUpdateVerificationLevelEvent
, RoleUpdateColorEvent
, RoleUpdateHoistedEvent
, RoleUpdateMentionableEvent
, RoleUpdateNameEvent
, RoleUpdatePermissionsEvent
, RoleUpdatePositionEvent
, SelfUpdateAvatarEvent
, SelfUpdateDiscriminatorEvent
, SelfUpdateEmailEvent
, SelfUpdateMFAEvent
, SelfUpdateMobileEvent
, SelfUpdateNameEvent
, SelfUpdateNitroEvent
, SelfUpdatePhoneNumberEvent
, SelfUpdateVerifiedEvent
, StatusChangeEvent
, TextChannelUpdateNameEvent
, TextChannelUpdateNSFWEvent
, TextChannelUpdateParentEvent
, TextChannelUpdatePositionEvent
, TextChannelUpdateSlowmodeEvent
, TextChannelUpdateTopicEvent
, UserUpdateAvatarEvent
, UserUpdateDiscriminatorEvent
, UserUpdateGameEvent
, UserUpdateNameEvent
, UserUpdateOnlineStatusEvent
, VoiceChannelUpdateBitrateEvent
, VoiceChannelUpdateNameEvent
, VoiceChannelUpdateParentEvent
, VoiceChannelUpdatePositionEvent
, VoiceChannelUpdateUserLimitEvent
public interface UpdateEvent<E,T>
Modifier and Type | Method | Description |
---|---|---|
E |
getEntity() |
The affected entity
|
default java.lang.Class<E> |
getEntityType() |
Class representation of the affected entity, useful when dealing with refection.
|
T |
getNewValue() |
The new value
|
T |
getOldValue() |
The old value
|
java.lang.String |
getPropertyIdentifier() |
The field name for the updated property
|
default java.lang.Class<E> getEntityType()
java.lang.String getPropertyIdentifier()
@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;
}
}
E getEntity()
T getOldValue()
T getNewValue()