Change update function and added new contrutor in the Groups

This commit is contained in:
Marcin Woźniak 2021-01-06 11:39:02 +01:00
parent fe06243bda
commit 8c0b880412
Signed by: y0rune
GPG Key ID: F204C385F57EB348
1 changed files with 27 additions and 1 deletions

View File

@ -11,6 +11,7 @@ import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.swing.GroupLayout.Group;
import com.plannaplan.types.GroupType;
import com.plannaplan.types.WeekDay;
@ -96,6 +97,26 @@ public class Groups {
this.type = capacity >= 50 ? GroupType.LECTURE : GroupType.CLASS;
}
/**
* Groups
*
* @param capacity capacity given to the groups
* @param room room given to the groups
* @param course course given to the groups
* @param time time given to the groups
* @param endTime end time of class in minutes
* @param day day given to the groups
* @param lecturer lecturer given to the groups
* @param zajCykId number of class in the term
* @param grNr Number of class/course
* @param type type of class/cource
*/
public Groups(int capacity, String room, Course course, int time, int endTime, WeekDay day, Lecturer lecturer,
Integer zajCykId, Integer grNr, GroupType type) {
this(capacity, room, course, time, endTime, day, lecturer, zajCykId, grNr);
this.type = type;
}
/**
* Groups
*
@ -159,9 +180,10 @@ public class Groups {
* @param endTime end time of class in minutes
* @param day day given to the groups
* @param lecturer lecturer given to the groups
* @param type type given to the groups
*/
public void update(Integer capacity, String room, Course course, Integer time, Integer endTime, WeekDay day,
Lecturer lecturer) {
Lecturer lecturer, GroupType type) {
if (capacity != null) {
this.capacity = capacity;
}
@ -189,6 +211,10 @@ public class Groups {
if (lecturer != null) {
this.lecturer = lecturer;
}
if (type != null) {
this.type = type;
}
}
/**