Fix backwards compatibility
This commit is contained in:
parent
1a1351c38f
commit
6722d8ee02
1 changed files with 6 additions and 3 deletions
|
@ -4,6 +4,7 @@ import java.io.BufferedReader;
|
||||||
import java.io.StringReader;
|
import java.io.StringReader;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
public class RankingListServer implements CommandExecutor {
|
public class RankingListServer implements CommandExecutor {
|
||||||
/**
|
/**
|
||||||
|
@ -39,7 +40,7 @@ public class RankingListServer implements CommandExecutor {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String createSortedText(List<Competitor> competitorList) {
|
public String createSortedText(List<Competitor> competitorList) {
|
||||||
List<Competitor> competitors = competitorList.stream().sorted().toList();
|
List<Competitor> competitors = competitorList.stream().sorted().collect(Collectors.toList());
|
||||||
String previousTime = null;
|
String previousTime = null;
|
||||||
int previousRank = 1;
|
int previousRank = 1;
|
||||||
|
|
||||||
|
@ -56,13 +57,15 @@ public class RankingListServer implements CommandExecutor {
|
||||||
|
|
||||||
return String.join(
|
return String.join(
|
||||||
System.lineSeparator(),
|
System.lineSeparator(),
|
||||||
competitors.stream().map((competitor) -> competitor.toString()).toList());
|
competitors.stream().map(
|
||||||
|
(competitor) -> competitor.toString()).collect(Collectors.toList()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public String createNameList(List<Competitor> competitorList) {
|
public String createNameList(List<Competitor> competitorList) {
|
||||||
return String.join(
|
return String.join(
|
||||||
System.lineSeparator(),
|
System.lineSeparator(),
|
||||||
competitorList.stream().sorted(new AlphaComparatorCompetitor()).map((competitor) -> competitor.toString()).toList());
|
competitorList.stream().sorted(new AlphaComparatorCompetitor()).map(
|
||||||
|
(competitor) -> competitor.toString()).collect(Collectors.toList()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public String execute(String rankingList) {
|
public String execute(String rankingList) {
|
||||||
|
|
Loading…
Reference in a new issue