EditScoreDialog shows penalties in lexicographical order

This commit is contained in:
Tim Hessenmüller
2020-09-10 14:57:11 +02:00
parent 0d67c3edcf
commit 668a29f42f
2 changed files with 11 additions and 2 deletions
@@ -1,5 +1,7 @@
package com.sap.sailing.domain.common;
import java.util.Arrays;
/**
* The reasons why a competitor may get the maximum number of points, usually equaling the
* number of competitors enlisted for the regatta plus one.
@@ -80,4 +82,10 @@ public enum MaxPointsReason {
public boolean isAppliesAtStartOfRace() {
return appliesAtStartOfRace;
}
public static MaxPointsReason[] getLexicographicalValues() {
MaxPointsReason[] result = MaxPointsReason.values();
Arrays.sort(result, (o1, o2) -> o1.name().compareToIgnoreCase(o2.name()));
return result;
}
}