File size: 592 Bytes
2311079 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
package com.tacticmaster.puzzle;
public record Puzzle(
String puzzleId,
String fen,
String moves,
int rating,
int ratingDeviation,
int popularity,
int nbPlays,
String themes,
String gameUrl,
String openingTags
) implements Comparable<Puzzle> {
@Override
public int compareTo(Puzzle o) {
int ratingComparison = Integer.compare(this.rating, o.rating);
if (ratingComparison != 0) {
return ratingComparison;
}
return this.puzzleId.compareTo(o.puzzleId);
}
}
|