2020-03-25 16:55:34 +01:00
|
|
|
package envoy.event;
|
|
|
|
|
2020-04-01 18:09:07 +02:00
|
|
|
import java.util.HashSet;
|
|
|
|
import java.util.Set;
|
|
|
|
|
|
|
|
import envoy.data.User;
|
|
|
|
|
2020-03-25 16:55:34 +01:00
|
|
|
/**
|
2020-03-28 15:21:02 +01:00
|
|
|
* This event creates a group with the given name.<br>
|
|
|
|
* <br>
|
2020-03-25 16:55:34 +01:00
|
|
|
* Project: <strong>envoy-common</strong><br>
|
2020-06-20 09:19:39 +02:00
|
|
|
* File: <strong>GroupCreation.java</strong><br>
|
2020-03-25 16:55:34 +01:00
|
|
|
* Created: <strong>25 Mar 2020</strong><br>
|
|
|
|
*
|
|
|
|
* @author Leon Hofmeister
|
|
|
|
* @since Envoy Common v0.1-beta
|
|
|
|
*/
|
2020-08-22 13:37:07 +02:00
|
|
|
public final class GroupCreation extends Event<String> {
|
2020-03-25 16:55:34 +01:00
|
|
|
|
2020-04-01 18:09:07 +02:00
|
|
|
private final Set<Long> initialMemberIDs;
|
|
|
|
|
2020-03-25 16:55:34 +01:00
|
|
|
private static final long serialVersionUID = 0L;
|
|
|
|
|
|
|
|
/**
|
2020-04-01 18:09:07 +02:00
|
|
|
* @param value the name of this group at creation time
|
|
|
|
* @param initialMemberIDs the IDs of all {@link User}s that should be group
|
|
|
|
* members from the beginning on (excluding the creator
|
|
|
|
* of this group)
|
|
|
|
* @since Envoy Common v0.1-beta
|
|
|
|
*/
|
2020-06-20 09:19:39 +02:00
|
|
|
public GroupCreation(String value, Set<Long> initialMemberIDs) {
|
2020-04-01 18:09:07 +02:00
|
|
|
super(value);
|
|
|
|
this.initialMemberIDs = (initialMemberIDs != null) ? initialMemberIDs : new HashSet<>();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return the IDs of all {@link User}s that are members from the beginning
|
|
|
|
* (excluding the creator of this group)
|
2020-03-25 16:55:34 +01:00
|
|
|
* @since Envoy Common v0.1-beta
|
|
|
|
*/
|
2020-04-01 18:09:07 +02:00
|
|
|
public Set<Long> getInitialMemberIDs() { return initialMemberIDs; }
|
2020-03-25 16:55:34 +01:00
|
|
|
}
|