diff --git a/restservice/src/main/java/com/plannaplan/responses/mappers/AssignmentResponseMappers.java b/restservice/src/main/java/com/plannaplan/responses/mappers/AssignmentResponseMappers.java index b5e4920..eb54a19 100755 --- a/restservice/src/main/java/com/plannaplan/responses/mappers/AssignmentResponseMappers.java +++ b/restservice/src/main/java/com/plannaplan/responses/mappers/AssignmentResponseMappers.java @@ -11,12 +11,25 @@ import com.plannaplan.entities.Groups; import com.plannaplan.responses.models.AssignmentResponse; import com.plannaplan.types.GroupType; +/** + * Mappers for Assingnmetns to api responses + */ public class AssignmentResponseMappers { + /** + * @param assignments lsit of assignments to be maped + * @return list of api responses + */ public static final List mapToResponse(List assignments) { return mapToResponse(assignments, null); } + /** + * + * @param assignments lsit of assignments to be maped + * @param ammounts ammounts to be take into account + * @return list of api responses + */ public static final List mapToResponse(List assignments, HashMap ammounts) { List response = new ArrayList<>(); diff --git a/restservice/src/main/java/com/plannaplan/responses/mappers/CommisionResponseMappers.java b/restservice/src/main/java/com/plannaplan/responses/mappers/CommisionResponseMappers.java index 7ce70d2..1962a4f 100755 --- a/restservice/src/main/java/com/plannaplan/responses/mappers/CommisionResponseMappers.java +++ b/restservice/src/main/java/com/plannaplan/responses/mappers/CommisionResponseMappers.java @@ -8,11 +8,22 @@ import com.plannaplan.entities.Commision; import com.plannaplan.responses.models.CommisionResponse; import com.plannaplan.responses.models.CommisionWithGroupsResponse; +/** + * Mappers for Commisions to api responses + */ public class CommisionResponseMappers { + /** + * @param commisions list of commisions to be mapped + * @return list of api responses + */ public static final List mapToResponse(List commisions) { return commisions.stream().filter(Objects::nonNull).map(CommisionResponse::new).collect(Collectors.toList()); } + /** + * @param commisions list of commisions to be mapped + * @return list of api responses + */ public static final List mapToResponseWithGroups(List commisions) { return commisions.stream().filter(Objects::nonNull).map(CommisionWithGroupsResponse::new) .collect(Collectors.toList()); diff --git a/restservice/src/main/java/com/plannaplan/responses/mappers/CoursesResponseMappers.java b/restservice/src/main/java/com/plannaplan/responses/mappers/CoursesResponseMappers.java index 5d9c1df..944a055 100755 --- a/restservice/src/main/java/com/plannaplan/responses/mappers/CoursesResponseMappers.java +++ b/restservice/src/main/java/com/plannaplan/responses/mappers/CoursesResponseMappers.java @@ -8,11 +8,22 @@ import com.plannaplan.entities.Course; import com.plannaplan.responses.models.CoursesDefaultResponse; import com.plannaplan.responses.models.CoursesWithGroupsResponse; +/** + * Mappers for Courses to api responses + */ public class CoursesResponseMappers { + /** + * @param courses list of courses to be mapped + * @return list of api responses + */ public static final List mapToGetCoursesResponse(List courses) { return courses.stream().filter(Objects::nonNull).map(CoursesDefaultResponse::new).collect(Collectors.toList()); } + /** + * @param courses list of courses to be mapped + * @return list of api responses + */ public static final List mapToGetCoursesWithGroupsResponse(List courses) { return courses.stream().filter(Objects::nonNull).map(CoursesWithGroupsResponse::new) .collect(Collectors.toList()); diff --git a/restservice/src/main/java/com/plannaplan/responses/mappers/ExchangeResponseMappers.java b/restservice/src/main/java/com/plannaplan/responses/mappers/ExchangeResponseMappers.java index 5adc9d6..bad9fef 100755 --- a/restservice/src/main/java/com/plannaplan/responses/mappers/ExchangeResponseMappers.java +++ b/restservice/src/main/java/com/plannaplan/responses/mappers/ExchangeResponseMappers.java @@ -7,7 +7,14 @@ import java.util.stream.Collectors; import com.plannaplan.entities.Exchange; import com.plannaplan.responses.models.ExchangeResponse; +/** + * Mappers for Exchange to api responses + */ public class ExchangeResponseMappers { + /** + * @param exchanges lsit of exchanges to be mapped + * @return list of api responses + */ public static final List mapToDefaultResponse(List exchanges) { return exchanges.stream().filter(Objects::nonNull).map(ExchangeResponse::new).collect(Collectors.toList()); } diff --git a/restservice/src/main/java/com/plannaplan/responses/mappers/GroupsMappers.java b/restservice/src/main/java/com/plannaplan/responses/mappers/GroupsMappers.java index 43779d3..ddabacd 100755 --- a/restservice/src/main/java/com/plannaplan/responses/mappers/GroupsMappers.java +++ b/restservice/src/main/java/com/plannaplan/responses/mappers/GroupsMappers.java @@ -13,7 +13,15 @@ import com.plannaplan.responses.models.CourseWithGroupsResponse; import com.plannaplan.responses.models.GroupWithCapacityResponse; import com.plannaplan.types.GroupType; +/** + * Mappers for Groups to api responses + */ public class GroupsMappers { + /** + * @param groups list of groups to be mapped + * @param taken ammoints to be take into account + * @return list of api responses + */ public static List mapToDefaultResponse(List groups, HashMap taken) { return groups.stream().filter(Objects::nonNull).map(new Function() { @Override @@ -27,10 +35,20 @@ public class GroupsMappers { }).collect(Collectors.toList()); } + /** + * + * @param groups list of groups to be mapped + * @return ammoints to be take into account + */ public static List mapToDefaultResponse(List groups) { return GroupsMappers.mapToDefaultResponse(groups, null); } + /** + * @param groups list of groups to be mapped + * @param taken ammoints to be take into account + * @return list of api responses + */ public static List mapToCapacityResponse(List groups, HashMap taken) { return groups.stream().filter(Objects::nonNull).map(new Function() { @@ -45,10 +63,19 @@ public class GroupsMappers { }).collect(Collectors.toList()); } + /** + * @param groups list of groups to be mapped + * @return ammoints to be take into account + */ public static List mapToCapacityResponse(List groups) { return GroupsMappers.mapToCapacityResponse(groups, null); } + /** + * @param groups list of groups to be mapped + * @param taken ammoints to be take into account + * @return list of api responses + */ public static CourseWithGroupsResponse mapToGetCourseGroupsDefaultResponse( List groups, HashMap taken) { @@ -74,11 +101,20 @@ public class GroupsMappers { return new CourseWithGroupsResponse<>(classes, lectures); } + /** + * @param groups list of groups to be mapped + * @return ammoints to be take into account + */ public static CourseWithGroupsResponse mapToGetCourseGroupsDefaultResponse( List groups) { return GroupsMappers.mapToGetCourseGroupsDefaultResponse(groups, null); } + /** + * @param groups list of groups to be mapped + * @param taken ammoints to be take into account + * @return list of api responses + */ public static CourseWithGroupsResponse mapToGetCourseGroupsWithCapacityResponse( List groups, HashMap taken) { @@ -105,6 +141,10 @@ public class GroupsMappers { return new CourseWithGroupsResponse<>(classes, lectures); } + /** + * @param groups list of groups to be mapped + * @return ammoints to be take into account + */ public static CourseWithGroupsResponse mapToGetCourseGroupsWithCapacityResponse( List groups) { return GroupsMappers.mapToGetCourseGroupsWithCapacityResponse(groups, null); diff --git a/restservice/src/main/java/com/plannaplan/responses/mappers/UserResponseMappers.java b/restservice/src/main/java/com/plannaplan/responses/mappers/UserResponseMappers.java index 096b20e..bef8dd3 100755 --- a/restservice/src/main/java/com/plannaplan/responses/mappers/UserResponseMappers.java +++ b/restservice/src/main/java/com/plannaplan/responses/mappers/UserResponseMappers.java @@ -7,9 +7,15 @@ import java.util.stream.Collectors; import com.plannaplan.entities.User; import com.plannaplan.responses.models.UserResponse; +/** + * Mappers for Users to api responses + */ public class UserResponseMappers { + /** + * @param groups list of groups to be mapped + * @return list of api responses + */ public static List mapToDefaultResponse(List groups) { - return groups.stream().filter(Objects::nonNull).map(UserResponse::new) - .collect(Collectors.toList()); + return groups.stream().filter(Objects::nonNull).map(UserResponse::new).collect(Collectors.toList()); } }