Skip to content

Commit 8009826

Browse files
authored
Merge pull request #17 from Lunawood/master
fix: Sorting By Percent
2 parents 8642c02 + 38d10ca commit 8009826

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docker-test-server/src/main/java/com/example/server/model/ToothDataAnalyzer.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,18 @@ public static class ToothReport implements Comparable<ToothReport>{
2121
@Override
2222
public int compareTo(ToothReport other) {
2323
// null 체크
24-
if (this.name == null && other.name == null) {
24+
if (this.percent == null && other.percent == null) {
2525
return 0;
2626
}
27-
if (this.name == null) {
27+
if (this.percent == null) {
2828
return -1;
2929
}
30-
if (other.name == null) {
30+
if (other.percent == null) {
3131
return 1;
3232
}
3333

3434
// name을 기준으로 오름차순 정렬
35-
return this.name.compareTo(other.name);
35+
return this.percent.compareTo(other.percent);
3636
}
3737
}
3838
}

0 commit comments

Comments
 (0)