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; } }