-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMusic.java
74 lines (60 loc) · 1.5 KB
/
Music.java
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
package cn.edu.bistu.music.empty;
import java.util.Objects;
/***
* 音乐实体类
* 记录了 音乐的id,用于在 网易云中取得mp3文件
* 音乐的标题
* 音乐的作者
* 音乐的专辑
*/
public class Music {
private String id;
private String title;
private String art;
private String album;
public Music(){}
public String getAlbum() {
return album;
}
public String getArt() {
return art;
}
public String getId() {
return id;
}
public String getTitle() {
return title;
}
public void setAlbum(String album) {
this.album = album;
}
public void setArt(String art) {
this.art = art;
}
public void setId(String id) {
this.id = id;
}
public void setTitle(String title) {
this.title = title;
}
@Override
public String toString() {
return "Music {" +
"id='" + id + '\'' +
", title='" + title + '\'' +
", art='" + art + '\'' +
", album='" + album + '\'' +
'}';
}
@Override
public boolean equals(Object o) {
if (o == null || getClass() != o.getClass()) return false;
Music music = (Music) o;
System.out.println(music.toString());
return id.equals(music.id);
}
@Override
public int hashCode() {
return Objects.hash(id);
}
}