2020-03-25 16:55:34 +01:00
|
|
|
package envoy.event;
|
|
|
|
|
2020-09-25 14:29:23 +02:00
|
|
|
import java.util.*;
|
2020-04-01 18:09:07 +02:00
|
|
|
|
|
|
|
import envoy.data.User;
|
|
|
|
|
2020-03-25 16:55:34 +01:00
|
|
|
/**
|
2020-09-25 14:29:23 +02:00
|
|
|
* This event creates a group with the given name.
|
2020-03-25 16:55:34 +01:00
|
|
|
*
|
|
|
|
* @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-10-11 23:04:25 +02:00
|
|
|
* @param name the name of this group at creation time
|
2020-10-19 18:17:51 +02:00
|
|
|
* @param initialMemberIDs the IDs of all {@link User}s that should be group members from the
|
|
|
|
* beginning on (excluding the creator of this group)
|
2020-04-01 18:09:07 +02:00
|
|
|
* @since Envoy Common v0.1-beta
|
|
|
|
*/
|
2020-10-11 23:04:25 +02:00
|
|
|
public GroupCreation(String name, Set<Long> initialMemberIDs) {
|
|
|
|
super(name);
|
2020-09-25 14:29:23 +02:00
|
|
|
this.initialMemberIDs = initialMemberIDs != null ? initialMemberIDs : new HashSet<>();
|
2020-04-01 18:09:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2020-10-19 18:17:51 +02:00
|
|
|
* @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
|
|
|
}
|