mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-24 14:38:45 +00:00
bug3465: many more areas where many course areas are now supported for Leaderboard and Regatta
This commit is contained in:
+1
-3
@@ -6,7 +6,6 @@ import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import com.sap.sailing.domain.common.LeaderboardType;
|
||||
import com.sap.sailing.domain.common.RaceIdentifier;
|
||||
@@ -29,8 +28,7 @@ public abstract class AbstractLeaderboardDTO extends NamedDTO implements Seriali
|
||||
*/
|
||||
public String regattaName;
|
||||
public String displayName;
|
||||
public UUID defaultCourseAreaId;
|
||||
public String defaultCourseAreaName;
|
||||
public List<CourseAreaDTO> courseAreas;
|
||||
public ScoringSchemeType scoringScheme;
|
||||
public LeaderboardType type;
|
||||
public boolean canBoatsOfCompetitorsChangePerRace;
|
||||
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
package com.sap.sailing.domain.common.dto;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import com.sap.sse.security.shared.dto.NamedDTO;
|
||||
|
||||
/**
|
||||
* Equality and hash code are based on the course area's {@link #id}.
|
||||
*/
|
||||
public class CourseAreaDTO extends NamedDTO {
|
||||
private static final long serialVersionUID = -5279690838452265454L;
|
||||
public UUID id;
|
||||
|
||||
public CourseAreaDTO() {
|
||||
}
|
||||
|
||||
public CourseAreaDTO(String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
public UUID getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = prime * ((id == null) ? 0 : id.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
CourseAreaDTO other = (CourseAreaDTO) obj;
|
||||
if (id == null) {
|
||||
if (other.id != null)
|
||||
return false;
|
||||
} else if (!id.equals(other.id))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
+6
-14
@@ -56,8 +56,7 @@ public class IncrementalLeaderboardDTO extends LeaderboardDTO implements Increme
|
||||
private boolean competitorDisplayNamesUnchanged;
|
||||
private boolean regattaNameUnchanged;
|
||||
private boolean displayNameUnchanged;
|
||||
private boolean defaultCourseAreaIdAsStringUnchanged;
|
||||
private boolean defaultCourseAreaNameUnchanged;
|
||||
private boolean courseAreasUnchanged;
|
||||
private boolean boatClassUnchanged;
|
||||
|
||||
/**
|
||||
@@ -352,11 +351,8 @@ public class IncrementalLeaderboardDTO extends LeaderboardDTO implements Increme
|
||||
if (this.commentUnchanged) {
|
||||
this.setComment(previousVersion.getComment());
|
||||
}
|
||||
if (this.defaultCourseAreaIdAsStringUnchanged) {
|
||||
this.defaultCourseAreaId = previousVersion.defaultCourseAreaId;
|
||||
}
|
||||
if (this.defaultCourseAreaNameUnchanged) {
|
||||
this.defaultCourseAreaName = previousVersion.defaultCourseAreaName;
|
||||
if (this.courseAreasUnchanged) {
|
||||
this.courseAreas = previousVersion.courseAreas;
|
||||
}
|
||||
if (this.displayNameUnchanged) {
|
||||
this.displayName = previousVersion.displayName;
|
||||
@@ -519,13 +515,9 @@ public class IncrementalLeaderboardDTO extends LeaderboardDTO implements Increme
|
||||
this.displayName = null;
|
||||
this.displayNameUnchanged = true;
|
||||
}
|
||||
if (Util.equalsWithNull(this.defaultCourseAreaId, previousVersion.defaultCourseAreaId)) {
|
||||
this.defaultCourseAreaId = null;
|
||||
this.defaultCourseAreaIdAsStringUnchanged = true;
|
||||
}
|
||||
if (Util.equalsWithNull(this.defaultCourseAreaName, previousVersion.defaultCourseAreaName)) {
|
||||
this.defaultCourseAreaName = null;
|
||||
this.defaultCourseAreaNameUnchanged = true;
|
||||
if (Util.equalsWithNull(this.courseAreas, previousVersion.courseAreas)) {
|
||||
this.courseAreas = null;
|
||||
this.courseAreasUnchanged = true;
|
||||
}
|
||||
if (Util.equalsWithNull(this.getBoatClass(), previousVersion.getBoatClass())) {
|
||||
this.setBoatClass(null);
|
||||
|
||||
Reference in New Issue
Block a user