mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-22 21:55:39 +00:00
use sail number instead of name as stable sorting for CompetitorWithBoat
This commit is contained in:
+10
@@ -97,4 +97,14 @@ public interface Competitor extends NamedWithID, IsManagedByCache<SharedDomainFa
|
||||
*/
|
||||
Duration getTimeOnDistanceAllowancePerNauticalMile();
|
||||
|
||||
/**
|
||||
* When two competitors score the same in a leaderboard and the tie cannot be broken, in order to avoid oscillations
|
||||
* when users roam across different replicas, a stable ordering criterion is still required. This may be the name
|
||||
* or the sail number (in case this is a competitor with boat).<p>
|
||||
*
|
||||
* This default implementation uses the {@link #getName() name}.
|
||||
*/
|
||||
default String getStableLastResortOrderingCriterion() {
|
||||
return getName();
|
||||
}
|
||||
}
|
||||
|
||||
+4
@@ -6,4 +6,8 @@ package com.sap.sailing.domain.base;
|
||||
* @author fmittag
|
||||
*/
|
||||
public interface CompetitorWithBoat extends Competitor, WithBoat {
|
||||
@Override
|
||||
default String getStableLastResortOrderingCriterion() {
|
||||
return getBoat().getSailID();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user