added javaDoc for GroupService
This commit is contained in:
@ -49,7 +49,7 @@ public class ControllerService {
|
|||||||
* @param title Gruppentitel
|
* @param title Gruppentitel
|
||||||
* @param description Gruppenbeschreibung
|
* @param description Gruppenbeschreibung
|
||||||
*/
|
*/
|
||||||
public void createGroup(Account account, String title, String description, Boolean visibility, Boolean maxInfiniteUsers, Long userMaximum, UUID parent) throws EventException {
|
public void createGroup(Account account, String title, String description, Boolean visibility, Boolean maxInfiniteUsers, Long userMaximum, UUID parent) {
|
||||||
Visibility visibility1;
|
Visibility visibility1;
|
||||||
maxInfiniteUsers = maxInfiniteUsers != null;
|
maxInfiniteUsers = maxInfiniteUsers != null;
|
||||||
|
|
||||||
@ -75,7 +75,7 @@ public class ControllerService {
|
|||||||
updateRole(account.getName(), groupId);
|
updateRole(account.getName(), groupId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public UUID createOrga(Account account, String title, String description, Boolean visibility, Boolean lecture, Boolean maxInfiniteUsers, Long userMaximum, UUID parent) throws EventException, IOException {
|
public UUID createOrga(Account account, String title, String description, Boolean visibility, Boolean lecture, Boolean maxInfiniteUsers, Long userMaximum, UUID parent) {
|
||||||
maxInfiniteUsers = maxInfiniteUsers != null;
|
maxInfiniteUsers = maxInfiniteUsers != null;
|
||||||
|
|
||||||
if (maxInfiniteUsers) {
|
if (maxInfiniteUsers) {
|
||||||
|
|||||||
@ -61,6 +61,13 @@ public class GroupService {
|
|||||||
return new ArrayList<>(groupMap.values());
|
return new ArrayList<>(groupMap.values());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gibt die Gruppe mit der richtigen Id aus der übergebenen Map wieder, existiert diese nicht
|
||||||
|
* wird die Gruppe erstellt und der Map hizugefügt.
|
||||||
|
* @param groups Map aus GruppenIds und Gruppen
|
||||||
|
* @param groupId Die Id der Gruppe, die zurückgegeben werden soll
|
||||||
|
* @return Die gesuchte Gruppe
|
||||||
|
*/
|
||||||
private Group getOrCreateGroup(Map<UUID, Group> groups, UUID groupId) {
|
private Group getOrCreateGroup(Map<UUID, Group> groups, UUID groupId) {
|
||||||
if (!groups.containsKey(groupId)) {
|
if (!groups.containsKey(groupId)) {
|
||||||
groups.put(groupId, new Group());
|
groups.put(groupId, new Group());
|
||||||
@ -136,6 +143,10 @@ public class GroupService {
|
|||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sortiert die übergebene Liste an Gruppen, sodass Veranstaltungen am Anfang der Liste sind.
|
||||||
|
* @param groups Die Liste von Gruppen die sortiert werden soll
|
||||||
|
*/
|
||||||
public void sortByGroupType(List<Group> groups) {
|
public void sortByGroupType(List<Group> groups) {
|
||||||
groups.sort((g1, g2) -> {
|
groups.sort((g1, g2) -> {
|
||||||
if (g1.getType() == GroupType.LECTURE) {
|
if (g1.getType() == GroupType.LECTURE) {
|
||||||
|
|||||||
Reference in New Issue
Block a user