backend/restservice/src/main/java/com/plannaplan/responses/models/GroupWithCapacityResponse.java
2020-11-30 12:35:35 +01:00

35 lines
981 B
Java
Executable File

package com.plannaplan.responses.models;
import com.plannaplan.entities.Assignment;
import com.plannaplan.entities.Groups;
import io.swagger.annotations.ApiModel;
@ApiModel(description = "Response shows information about group with included capacity.", value = "GroupWithCapacityResponse")
public class GroupWithCapacityResponse extends GroupDefaultResponse {
private int capacity;
public GroupWithCapacityResponse(Groups group) {
super(group);
this.capacity = group.getCapacity();
}
public GroupWithCapacityResponse(Groups group, int takenPlaces) {
super(group, takenPlaces);
this.capacity = group.getCapacity();
}
public GroupWithCapacityResponse(Assignment assignment) {
this(assignment.getGroup());
}
public GroupWithCapacityResponse(Assignment assignment, int takenPlaces) {
this(assignment.getGroup(), takenPlaces);
}
public int getCapacity() {
return capacity;
}
}