Repository navigation
Expand file tree
/
Copy pathMedia.java
More file actions
executable file
·111 lines (93 loc) · 3.88 KB
/
Copy pathMedia.java
File metadata and controls
executable file
·111 lines (93 loc) · 3.88 KB
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
package data.media;
import static data.ReprUtil.repr;
import java.util.List;
@SuppressWarnings("serial")
public class Media implements java.io.Serializable {
public enum Player {
JAVA, FLASH
}
public String uri;
public String title; // Can be unset.
public int width;
public int height;
public String format;
public long duration;
public long size;
public int bitrate; // Can be unset.
// required by JSONiJ
public boolean hasBitrate;
public List<String> persons;
public Player player;
// msgpack requires this
public String copyright; // Can be unset.
public Media(){
}
public Media(String uri, String title, int width, int height, String format, long duration, long size, int bitrate,
boolean hasBitrate, List<String> persons, Player player, String copyright){
this.uri = uri;
this.title = title;
this.width = width;
this.height = height;
this.format = format;
this.duration = duration;
this.size = size;
this.bitrate = bitrate;
this.hasBitrate = hasBitrate;
this.persons = persons;
this.player = player;
this.copyright = copyright;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Media media = (Media) o;
if (bitrate != media.bitrate) return false;
if (duration != media.duration) return false;
if (hasBitrate != media.hasBitrate) return false;
if (height != media.height) return false;
if (size != media.size) return false;
if (width != media.width) return false;
if (copyright != null ? !copyright.equals(media.copyright) : media.copyright != null) return false;
if (format != null ? !format.equals(media.format) : media.format != null) return false;
if (persons != null ? !persons.equals(media.persons) : media.persons != null) return false;
if (player != media.player) return false;
if (title != null ? !title.equals(media.title) : media.title != null) return false;
if (uri != null ? !uri.equals(media.uri) : media.uri != null) return false;
return true;
}
@Override
public int hashCode() {
int result = uri != null ? uri.hashCode() : 0;
result = 31 * result + (title != null ? title.hashCode() : 0);
result = 31 * result + width;
result = 31 * result + height;
result = 31 * result + (format != null ? format.hashCode() : 0);
result = 31 * result + (int) (duration ^ (duration >>> 32));
result = 31 * result + (int) (size ^ (size >>> 32));
result = 31 * result + bitrate;
result = 31 * result + (hasBitrate ? 1 : 0);
result = 31 * result + (persons != null ? persons.hashCode() : 0);
result = 31 * result + (player != null ? player.hashCode() : 0);
result = 31 * result + (copyright != null ? copyright.hashCode() : 0);
return result;
}
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("[Media ");
sb.append("uri=").append(repr(uri));
sb.append(", title=").append(repr(title));
sb.append(", width=").append(width);
sb.append(", height=").append(height);
sb.append(", format=").append(repr(format));
sb.append(", duration=").append(duration);
sb.append(", size=").append(size);
sb.append(", hasBitrate=").append(hasBitrate);
sb.append(", bitrate=").append(String.valueOf(bitrate));
sb.append(", persons=").append(repr(persons));
sb.append(", player=").append(player);
sb.append(", copyright=").append(copyright);
sb.append("]");
return sb.toString();
}
}