We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9e183ab commit 9f04edcCopy full SHA for 9f04edc
1 file changed
core/objs/music/MusicObj.java
@@ -1,6 +1,8 @@
1
package com.coloryr.allmusic.server.core.objs.music;
2
3
-public class MusicObj {
+import org.jspecify.annotations.NonNull;
4
+
5
+public class MusicObj implements Comparable {
6
/**
7
* 音乐编号
8
*/
@@ -9,4 +11,17 @@ public class MusicObj {
9
11
* 音乐API
10
12
13
public String api;
14
15
+ @Override
16
+ public int compareTo(@NonNull Object o) {
17
+ if (o instanceof MusicObj) {
18
+ MusicObj obj = (MusicObj) o;
19
+ int result = this.id.compareTo(obj.id);
20
+ if (result != 0) {
21
+ return result;
22
+ }
23
+ return this.api.compareTo(obj.api);
24
25
+ return 0;
26
27
}
0 commit comments