Interface UpdateEvent<E,​T>

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

        Example

        
         @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