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

63 lines
1.5 KiB
Java
Raw Normal View History

package com.plannaplan.responses.models;
import com.plannaplan.entities.Assignment;
import com.plannaplan.entities.Groups;
import io.swagger.annotations.ApiModel;
2021-01-15 17:45:29 +01:00
/**
* Group api response featuring group capacity
*/
@ApiModel(description = "Response shows information about group with included capacity.", value = "GroupWithCapacityResponse")
public class GroupWithCapacityResponse extends GroupDefaultResponse {
private int capacity;
2021-01-15 17:45:29 +01:00
/**
* create new instance
*
* @param group entity to map to api response
*/
public GroupWithCapacityResponse(Groups group) {
super(group);
this.capacity = group.getCapacity();
}
2021-01-15 17:45:29 +01:00
/**
* create new instance
*
* @param group entity to map to api response
* @param takenPlaces group taken places
*/
public GroupWithCapacityResponse(Groups group, int takenPlaces) {
super(group, takenPlaces);
this.capacity = group.getCapacity();
}
2021-01-15 17:45:29 +01:00
/**
* create new instance
*
* @param assignment entity to map to api response
*/
public GroupWithCapacityResponse(Assignment assignment) {
this(assignment.getGroup());
}
2021-01-15 17:45:29 +01:00
/**
* create new instance
*
* @param assignment entity to map to api response
* @param takenPlaces group taken places
*/
public GroupWithCapacityResponse(Assignment assignment, int takenPlaces) {
2021-01-20 15:38:42 +01:00
super(assignment, takenPlaces);
}
2021-01-15 17:45:29 +01:00
/**
* @return group taken places
*/
public int getCapacity() {
return capacity;
}
}