UpdateEvent<JDA,JDA.Status>
public class StatusChangeEvent extends Event implements UpdateEvent<JDA,JDA.Status>
Status
changed. (Example: SHUTTING_DOWN -> SHUTDOWN)
Identifier: status
Modifier and Type | Field | Description |
---|---|---|
static java.lang.String |
IDENTIFIER |
Constructor | Description |
---|---|
StatusChangeEvent(JDA api,
JDA.Status newStatus,
JDA.Status oldStatus) |
Modifier and Type | Method | Description |
---|---|---|
JDA |
getEntity() |
The affected entity
|
JDA.Status |
getNewStatus() |
The status that we changed to
|
JDA.Status |
getNewValue() |
The new value
|
JDA.Status |
getOldStatus() |
The previous status
|
JDA.Status |
getOldValue() |
The old value
|
java.lang.String |
getPropertyIdentifier() |
The field name for the updated property
|
java.lang.String |
toString() |
getJDA, getResponseNumber
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
getEntityType
public static final java.lang.String IDENTIFIER
public StatusChangeEvent(JDA api, JDA.Status newStatus, JDA.Status oldStatus)
public JDA.Status getNewStatus()
public JDA.Status getOldStatus()
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<JDA,JDA.Status>
public JDA getEntity()
UpdateEvent
getEntity
in interface UpdateEvent<JDA,JDA.Status>
public JDA.Status getOldValue()
UpdateEvent
getOldValue
in interface UpdateEvent<JDA,JDA.Status>
public JDA.Status getNewValue()
UpdateEvent
getNewValue
in interface UpdateEvent<JDA,JDA.Status>
public java.lang.String toString()
toString
in class java.lang.Object