backend/restservice/src/main/java/com/plannaplan/responses/models/DefaultGroupResponse.java
2020-10-13 18:03:37 +02:00

54 lines
1.3 KiB
Java
Executable File

package com.plannaplan.responses.models;
import com.plannaplan.entities.Assignment;
import com.plannaplan.entities.Groups;
import com.plannaplan.types.GroupType;
public class DefaultGroupResponse {
private Long id;
private int day;
private String time;
private String lecturer;
private String room;
private GroupType type;
public DefaultGroupResponse(Groups group) {
this.id = group.getId() != null ? group.getId() : null;
this.day = group.getDay() != null ? group.getDay().label : -1;
this.time = group.getTimeString() != null ? group.getTimeString() : "";
this.lecturer = group.getLecturer() != null ? group.getLecturer().toString() : "";
this.room = group.getRoom() != null ? group.getRoom() : "";
this.type = group.getType() != null ? group.getType() : null;
}
public DefaultGroupResponse(Assignment assignment) {
this(assignment.getGroup());
}
public GroupType getType() {
return type;
}
public String getRoom() {
return room;
}
public String getLecturer() {
return lecturer;
}
public String getTime() {
return time;
}
public int getDay() {
return day;
}
public Long getId() {
return id;
}
}