50 lines
1.3 KiB
Java
50 lines
1.3 KiB
Java
package envoy.event;
|
|
|
|
import envoy.data.User;
|
|
import envoy.data.User.UserStatus;
|
|
|
|
/**
|
|
* Project: <strong>envoy-common</strong><br>
|
|
* File: <strong>UserStatusChange.java</strong><br>
|
|
* Created: <strong>1 Feb 2020</strong><br>
|
|
*
|
|
* @author Leon Hofmeister
|
|
* @since Envoy Common v0.2-alpha
|
|
*/
|
|
public class UserStatusChange extends Event<UserStatus> {
|
|
|
|
private final long id;
|
|
|
|
private static final long serialVersionUID = 0L;
|
|
|
|
/**
|
|
* Initializes a {@link UserStatusChange}.
|
|
*
|
|
* @param id the ID of the {@link User} this event is related to
|
|
* @param status the status of the {@link User} this event is related
|
|
* to
|
|
* @since Envoy Common v0.2-alpha
|
|
*/
|
|
public UserStatusChange(long id, User.UserStatus status) {
|
|
super(status);
|
|
this.id = id;
|
|
}
|
|
|
|
/**
|
|
* Initializes a {@link UserStatusChange} through a User.
|
|
*
|
|
* @param user the User from which to build the event
|
|
* @since Envoy Common v0.2-alpha
|
|
*/
|
|
public UserStatusChange(User user) { this(user.getID(), user.getStatus()); }
|
|
|
|
/**
|
|
* @return the ID of the {@link User} this event is related to
|
|
* @since Envoy Common v0.2-alpha
|
|
*/
|
|
public long getID() { return id; }
|
|
|
|
@Override
|
|
public String toString() { return String.format("UserStatusChange[id=%d,status=%s]", id, value); }
|
|
}
|