package com.plannaplan.responses.models; import com.plannaplan.entities.Assignment; import com.plannaplan.entities.Groups; import io.swagger.annotations.ApiModel; /** * 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; /** * create new instance * * @param group entity to map to api response */ public GroupWithCapacityResponse(Groups group) { super(group); this.capacity = group.getCapacity(); } /** * 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(); } /** * create new instance * * @param assignment entity to map to api response */ public GroupWithCapacityResponse(Assignment assignment) { this(assignment.getGroup()); } /** * create new instance * * @param assignment entity to map to api response * @param takenPlaces group taken places */ public GroupWithCapacityResponse(Assignment assignment, int takenPlaces) { this(assignment.getGroup(), takenPlaces); } /** * @return group taken places */ public int getCapacity() { return capacity; } }