package design.model; import com.fasterxml.jackson.annotation.JsonCreator; import java.util.ArrayList; import java.util.Date; import java.util.List; public class ScrambleLeague extends League { private final List participants; @JsonCreator private ScrambleLeague(int id, String name, Date registrationDate, Date startDate, Date endDate, Golfer owner, List participants) { super(id, name, registrationDate, startDate, endDate, owner); this.participants = participants; } public ScrambleLeague(int id, String name, Date registrationDate, Date startDate, Date endDate, Golfer owner) { super(id, name, registrationDate, startDate, endDate, owner); this.participants = new ArrayList<>(); } public boolean addParticipants(Team e) { return participants.add(e); } public boolean removeParticipants(Team o) { return participants.remove(o); } public Team[] getParticipants() { return participants.toArray(Team[]::new); } }