UpdateEvent<SelfUser,T>
SelfUpdateAvatarEvent
, SelfUpdateDiscriminatorEvent
, SelfUpdateEmailEvent
, SelfUpdateMFAEvent
, SelfUpdateMobileEvent
, SelfUpdateNameEvent
, SelfUpdateNitroEvent
, SelfUpdatePhoneNumberEvent
, SelfUpdateVerifiedEvent
public abstract class GenericSelfUpdateEvent<T> extends Event implements UpdateEvent<SelfUser,T>
SelfUser
changed or started an activity.
Can be used to detect any SelfUserEvent.
Constructor | Description |
---|---|
GenericSelfUpdateEvent(JDA api,
long responseNumber,
T previous,
T next,
java.lang.String identifier) |
Modifier and Type | Method | Description |
---|---|---|
SelfUser |
getEntity() |
The affected entity
|
T |
getNewValue() |
The new value
|
T |
getOldValue() |
The old value
|
java.lang.String |
getPropertyIdentifier() |
The field name for the updated property
|
SelfUser |
getSelfUser() |
The
SelfUser |
java.lang.String |
toString() |
getJDA, getResponseNumber
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
getEntityType
public SelfUser getEntity()
UpdateEvent
getEntity
in interface UpdateEvent<SelfUser,T>
public java.lang.String getPropertyIdentifier()
UpdateEvent
@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;
}
}
getPropertyIdentifier
in interface UpdateEvent<SelfUser,T>
public T getOldValue()
UpdateEvent
getOldValue
in interface UpdateEvent<SelfUser,T>
public T getNewValue()
UpdateEvent
getNewValue
in interface UpdateEvent<SelfUser,T>
public java.lang.String toString()
toString
in class java.lang.Object