mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-25 06:58:39 +00:00
bug4811: massive NamedDTO constructor refactoring affecting all subclasses; starting with dialog for application replica set upgrade
This commit is contained in:
+6
-1
@@ -39,11 +39,16 @@ public abstract class AbstractLeaderboardDTO extends NamedDTO implements Seriali
|
||||
@Deprecated
|
||||
protected AbstractLeaderboardDTO() {} // for GWT serialization only
|
||||
|
||||
public AbstractLeaderboardDTO(BoatClassDTO boatClass) {
|
||||
public AbstractLeaderboardDTO(String name, BoatClassDTO boatClass) {
|
||||
super(name);
|
||||
this.boatClass = boatClass;
|
||||
races = new ArrayList<RaceColumnDTO>();
|
||||
}
|
||||
|
||||
public AbstractLeaderboardDTO(BoatClassDTO boatClass) {
|
||||
this(/* name */ "", boatClass);
|
||||
}
|
||||
|
||||
public BoatClassDTO getBoatClass() {
|
||||
return boatClass;
|
||||
}
|
||||
|
||||
+2
-1
@@ -25,7 +25,8 @@ public class BasicRaceDTO extends NamedDTO {
|
||||
public Date raceFinishedTime;
|
||||
public TrackedRaceDTO trackedRace;
|
||||
|
||||
public BasicRaceDTO() {} // for GWT serialization only
|
||||
@Deprecated
|
||||
BasicRaceDTO() {} // for GWT serialization only
|
||||
|
||||
public BasicRaceDTO(RegattaAndRaceIdentifier raceIdentifier, TrackedRaceDTO trackedRace) {
|
||||
super(raceIdentifier.getRaceName());
|
||||
|
||||
+1
@@ -17,6 +17,7 @@ public class BoatClassDTO extends NamedDTO implements Serializable, Comparable<B
|
||||
private Distance hullLength;
|
||||
private Distance hullBeam;
|
||||
|
||||
@Deprecated
|
||||
BoatClassDTO() {}
|
||||
|
||||
public BoatClassDTO(String name, Distance hullLength, Distance hullBeam) {
|
||||
|
||||
+3
-2
@@ -20,8 +20,9 @@ public class BoatDTO extends NamedSecuredObjectDTO implements WithID, Serializab
|
||||
private String sailId;
|
||||
private Color color;
|
||||
|
||||
// for GWT
|
||||
public BoatDTO() {}
|
||||
public BoatDTO() {
|
||||
super("");
|
||||
}
|
||||
|
||||
public BoatDTO(String idAsString, String name, BoatClassDTO boatClass, String sailId) {
|
||||
this(idAsString, name, boatClass, sailId, null);
|
||||
|
||||
+3
-1
@@ -34,7 +34,9 @@ public class CompetitorDTOImpl extends NamedSecuredObjectDTO implements Competit
|
||||
private Double timeOnTimeFactor;
|
||||
private Duration timeOnDistanceAllowancePerNauticalMile;
|
||||
|
||||
public CompetitorDTOImpl() {}
|
||||
protected CompetitorDTOImpl() {
|
||||
super("");
|
||||
}
|
||||
|
||||
public CompetitorDTOImpl(String name, String shortName, Color color, String email, String twoLetterIsoCountryCode, String threeLetterIocCountryCode,
|
||||
String countryName, String idAsString, String imageURL, String flagImageURL,
|
||||
|
||||
+2
-2
@@ -11,8 +11,8 @@ public class CourseAreaDTO extends NamedDTO {
|
||||
private static final long serialVersionUID = -5279690838452265454L;
|
||||
public UUID id;
|
||||
|
||||
public CourseAreaDTO() {
|
||||
}
|
||||
@Deprecated
|
||||
CourseAreaDTO() {} // for GWT RPC serialization only
|
||||
|
||||
public CourseAreaDTO(String name) {
|
||||
super(name);
|
||||
|
||||
+2
-1
@@ -8,7 +8,8 @@ public class FleetDTO extends NamedDTO {
|
||||
private Color color;
|
||||
private int orderNo;
|
||||
|
||||
public FleetDTO() {}
|
||||
@Deprecated
|
||||
FleetDTO() {} // for GWT RPC serialization only
|
||||
|
||||
public FleetDTO(String fleetName, int orderNo, Color color) {
|
||||
super(fleetName);
|
||||
|
||||
+4
-4
@@ -70,10 +70,10 @@ public class LeaderboardDTO extends AbstractLeaderboardDTO implements Serializab
|
||||
* @param uuidGenerator used to provide the {@link #id ID} for this object (see also {@link #getId()}) and for any clones produced
|
||||
* from it by the {@link #clone()} operation.
|
||||
*/
|
||||
public LeaderboardDTO(Date timepoint, Date timePointOfLastCorrectionsValidity, String comment,
|
||||
ScoringSchemeType scoringScheme, boolean higherScoreIsBetter, UUIDGenerator uuidGenerator,
|
||||
boolean hasOverallDetails, BoatClassDTO boatClass) {
|
||||
super(boatClass);
|
||||
public LeaderboardDTO(String name, Date timepoint, Date timePointOfLastCorrectionsValidity,
|
||||
String comment, ScoringSchemeType scoringScheme, boolean higherScoreIsBetter,
|
||||
UUIDGenerator uuidGenerator, boolean hasOverallDetails, BoatClassDTO boatClass) {
|
||||
super(name, boatClass);
|
||||
initCollections();
|
||||
id = uuidGenerator.generateRandomUUID();
|
||||
this.timePoint = timepoint;
|
||||
|
||||
+4
@@ -4,6 +4,10 @@ import java.util.ArrayList;
|
||||
|
||||
public class MetaLeaderboardRaceColumnDTO extends RaceColumnDTO {
|
||||
|
||||
public MetaLeaderboardRaceColumnDTO(String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
private static final long serialVersionUID = 6152752963316150432L;
|
||||
|
||||
private ArrayList<BasicRaceDTO> raceList = new ArrayList<BasicRaceDTO>();
|
||||
|
||||
+1
@@ -11,6 +11,7 @@ public class PersonDTO extends NamedDTO {
|
||||
private String description;
|
||||
private String nationalityThreeLetterIOCAcronym;
|
||||
|
||||
@Deprecated
|
||||
PersonDTO() {} // for GWT de-serialization only
|
||||
|
||||
public PersonDTO(String name, Date dateOfBirth, String description, String nationalityThreeLetterIOCAcronym) {
|
||||
|
||||
+2
-1
@@ -12,7 +12,8 @@ public class PlacemarkDTO extends NamedDTO {
|
||||
/**
|
||||
* Constructor for serialization.
|
||||
*/
|
||||
PlacemarkDTO() {}
|
||||
@Deprecated
|
||||
PlacemarkDTO() {} // for GWT RPC serialization only
|
||||
|
||||
public PlacemarkDTO(String name, String countryCode, Position position, long population) {
|
||||
super(name);
|
||||
|
||||
+2
-3
@@ -1,13 +1,12 @@
|
||||
package com.sap.sailing.domain.common.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import com.sap.sse.security.shared.dto.NamedDTO;
|
||||
|
||||
public class PlacemarkOrderDTO extends NamedDTO {
|
||||
public class PlacemarkOrderDTO implements Serializable {
|
||||
private static final long serialVersionUID = -4981887843843495494L;
|
||||
private List<PlacemarkDTO> placemarks;
|
||||
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ public class PreviousCompetitorDTOImpl extends NamedSecuredObjectDTO implements
|
||||
PreviousCompetitorDTOImpl() {} // for serialization only
|
||||
|
||||
public PreviousCompetitorDTOImpl(int indexInPreviousCompetitorList) {
|
||||
super();
|
||||
super(null); // name is not needed here
|
||||
this.indexInPreviousCompetitorList = indexInPreviousCompetitorList;
|
||||
}
|
||||
|
||||
|
||||
+5
-1
@@ -27,7 +27,11 @@ public class RaceColumnDTO extends NamedDTO implements Serializable {
|
||||
|
||||
public enum RaceColumnLiveState { NOT_TRACKED, TRACKED, TRACKED_AND_LIVE };
|
||||
|
||||
public RaceColumnDTO() {
|
||||
@Deprecated
|
||||
RaceColumnDTO() {} // for GWT RPC serialization only
|
||||
|
||||
public RaceColumnDTO(String name) {
|
||||
super(name);
|
||||
trackedRaceIdentifiersPerFleet = new HashMap<FleetDTO, RegattaAndRaceIdentifier>();
|
||||
raceLogTrackingInfos = new HashMap<FleetDTO, RaceLogTrackingInfoDTO>();
|
||||
racesPerFleet = new HashMap<FleetDTO, RaceDTO>();
|
||||
|
||||
+4
-5
@@ -15,16 +15,15 @@ public class RaceColumnDTOFactory {
|
||||
String regattaName, String seriesName, boolean isMetaLeaderboardColumn) {
|
||||
final RaceColumnDTO raceColumnDTO;
|
||||
if (seriesName != null) {
|
||||
raceColumnDTO = new RaceColumnInSeriesDTO(seriesName, regattaName);
|
||||
raceColumnDTO = new RaceColumnInSeriesDTO(columnName, seriesName, regattaName);
|
||||
} else {
|
||||
raceColumnDTO = isMetaLeaderboardColumn ? new MetaLeaderboardRaceColumnDTO() : new RaceColumnDTO();
|
||||
raceColumnDTO = isMetaLeaderboardColumn ? new MetaLeaderboardRaceColumnDTO(columnName) : new RaceColumnDTO(columnName);
|
||||
}
|
||||
fillRaceColumnDTO(raceColumnDTO, columnName, isMedal, explicitFactor);
|
||||
fillRaceColumnDTO(raceColumnDTO, isMedal, explicitFactor);
|
||||
return raceColumnDTO;
|
||||
}
|
||||
|
||||
private void fillRaceColumnDTO(RaceColumnDTO raceColumnDTO, String columnName, boolean isMedal, Double explicitFactor) {
|
||||
raceColumnDTO.setName(columnName);
|
||||
private void fillRaceColumnDTO(RaceColumnDTO raceColumnDTO, boolean isMedal, Double explicitFactor) {
|
||||
raceColumnDTO.setMedalRace(isMedal);
|
||||
raceColumnDTO.setExplicitFactor(explicitFactor);
|
||||
}
|
||||
|
||||
+3
-2
@@ -5,10 +5,11 @@ public class RaceColumnInSeriesDTO extends RaceColumnDTO {
|
||||
private String seriesName;
|
||||
private String regattaName;
|
||||
|
||||
@Deprecated
|
||||
RaceColumnInSeriesDTO() {} // for GWT serialization
|
||||
|
||||
public RaceColumnInSeriesDTO(String seriesName, String regattaName) {
|
||||
super();
|
||||
public RaceColumnInSeriesDTO(String name, String seriesName, String regattaName) {
|
||||
super(name);
|
||||
this.seriesName = seriesName;
|
||||
this.regattaName = regattaName;
|
||||
}
|
||||
|
||||
@@ -41,6 +41,7 @@ public class RaceDTO extends BasicRaceDTO implements SecuredDTO {
|
||||
|
||||
private RegattaAndRaceIdentifier raceIdentifier;
|
||||
|
||||
@Deprecated
|
||||
public RaceDTO() {}
|
||||
|
||||
public RaceDTO(RegattaAndRaceIdentifier raceIdentifier, TrackedRaceDTO trackedRace, boolean isCurrentlyTracked, RankingMetrics rankingMetricType) {
|
||||
|
||||
Reference in New Issue
Block a user