1

added javaDoc for GroupService

This commit is contained in:
[Mahgs]
2020-03-26 13:14:35 +01:00
parent f15d1f850d
commit ae468f4afc
2 changed files with 13 additions and 2 deletions

View File

@ -49,7 +49,7 @@ public class ControllerService {
* @param title Gruppentitel
* @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;
maxInfiniteUsers = maxInfiniteUsers != null;
@ -75,7 +75,7 @@ public class ControllerService {
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;
if (maxInfiniteUsers) {

View File

@ -61,6 +61,13 @@ public class GroupService {
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) {
if (!groups.containsKey(groupId)) {
groups.put(groupId, new Group());
@ -136,6 +143,10 @@ public class GroupService {
.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) {
groups.sort((g1, g2) -> {
if (g1.getType() == GroupType.LECTURE) {