backend/restservice/src/main/java/com/plannaplan/responses/models/AssignmentResponse.java

60 lines
1.4 KiB
Java
Raw Normal View History

2020-10-08 15:57:42 +02:00
package com.plannaplan.responses.models;
import com.plannaplan.entities.Assignment;
2020-10-08 15:57:42 +02:00
import com.plannaplan.entities.Groups;
import com.plannaplan.types.GroupType;
public class AssignmentResponse {
private Long id;
private int day;
private String time;
private String lecturer;
private String room;
private int capacity;
private GroupType type;
public AssignmentResponse(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() : "";
2020-10-08 15:57:42 +02:00
this.capacity = group.getCapacity();
this.type = group.getType() != null ? group.getType() : null;
}
public AssignmentResponse(Assignment assignment) {
this(assignment.getGroup());
2020-10-08 15:57:42 +02:00
}
public GroupType getType() {
return type;
}
public int getCapacity() {
return capacity;
}
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;
}
}