1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
package net.sourceforge.subsonic.androidapp.domain; |
20 |
|
|
21 |
|
import java.util.ArrayList; |
22 |
|
import java.util.List; |
23 |
|
import java.io.Serializable; |
24 |
|
|
25 |
|
|
26 |
|
@author |
27 |
|
|
|
|
| 50% |
Uncovered Elements: 10 (20) |
Complexity: 11 |
Complexity Density: 1 |
|
28 |
|
public class MusicDirectory { |
29 |
|
|
30 |
|
private String name; |
31 |
|
private final List<Entry> children = new ArrayList<Entry>(); |
32 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
33 |
0
|
public String getName() {... |
34 |
0
|
return name; |
35 |
|
} |
36 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
37 |
5
|
public void setName(String name) {... |
38 |
5
|
this.name = name; |
39 |
|
} |
40 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
41 |
332
|
public void addChild(Entry child) {... |
42 |
332
|
children.add(child); |
43 |
|
} |
44 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
45 |
27
|
public List<Entry> getChildren() {... |
46 |
27
|
return getChildren(true, true); |
47 |
|
} |
48 |
|
|
|
|
| 27,3% |
Uncovered Elements: 8 (11) |
Complexity: 7 |
Complexity Density: 1 |
|
49 |
27
|
public List<Entry> getChildren(boolean includeDirs, boolean includeFiles) {... |
50 |
27
|
if (includeDirs && includeFiles) { |
51 |
27
|
return children; |
52 |
|
} |
53 |
|
|
54 |
0
|
List<Entry> result = new ArrayList<Entry>(children.size()); |
55 |
0
|
for (Entry child : children) { |
56 |
0
|
if (child.isDirectory() && includeDirs || !child.isDirectory() && includeFiles) { |
57 |
0
|
result.add(child); |
58 |
|
} |
59 |
|
} |
60 |
0
|
return result; |
61 |
|
} |
62 |
|
|
|
|
| 86,8% |
Uncovered Elements: 12 (91) |
Complexity: 44 |
Complexity Density: 0,96 |
|
63 |
|
public static class Entry implements Serializable { |
64 |
|
private String id; |
65 |
|
private String parent; |
66 |
|
private boolean directory; |
67 |
|
private String title; |
68 |
|
private String album; |
69 |
|
private String artist; |
70 |
|
private Integer track; |
71 |
|
private Integer year; |
72 |
|
private String genre; |
73 |
|
private String contentType; |
74 |
|
private String suffix; |
75 |
|
private String transcodedContentType; |
76 |
|
private String transcodedSuffix; |
77 |
|
private String coverArt; |
78 |
|
private Long size; |
79 |
|
private Integer duration; |
80 |
|
private Integer bitRate; |
81 |
|
private String path; |
82 |
|
private boolean video; |
83 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
84 |
98
|
public String getId() {... |
85 |
98
|
return id; |
86 |
|
} |
87 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
88 |
333
|
public void setId(String id) {... |
89 |
333
|
this.id = id; |
90 |
|
} |
91 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
92 |
5
|
public String getParent() {... |
93 |
5
|
return parent; |
94 |
|
} |
95 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
96 |
333
|
public void setParent(String parent) {... |
97 |
333
|
this.parent = parent; |
98 |
|
} |
99 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
100 |
1025
|
public boolean isDirectory() {... |
101 |
1025
|
return directory; |
102 |
|
} |
103 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
104 |
333
|
public void setDirectory(boolean directory) {... |
105 |
333
|
this.directory = directory; |
106 |
|
} |
107 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
108 |
533
|
public String getTitle() {... |
109 |
533
|
return title; |
110 |
|
} |
111 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
112 |
333
|
public void setTitle(String title) {... |
113 |
333
|
this.title = title; |
114 |
|
} |
115 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
116 |
119
|
public String getAlbum() {... |
117 |
119
|
return album; |
118 |
|
} |
119 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
120 |
272
|
public void setAlbum(String album) {... |
121 |
272
|
this.album = album; |
122 |
|
} |
123 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
124 |
412
|
public String getArtist() {... |
125 |
412
|
return artist; |
126 |
|
} |
127 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
128 |
333
|
public void setArtist(String artist) {... |
129 |
333
|
this.artist = artist; |
130 |
|
} |
131 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
132 |
164
|
public Integer getTrack() {... |
133 |
164
|
return track; |
134 |
|
} |
135 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
136 |
202
|
public void setTrack(Integer track) {... |
137 |
202
|
this.track = track; |
138 |
|
} |
139 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
140 |
0
|
public Integer getYear() {... |
141 |
0
|
return year; |
142 |
|
} |
143 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
144 |
202
|
public void setYear(Integer year) {... |
145 |
202
|
this.year = year; |
146 |
|
} |
147 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
148 |
0
|
public String getGenre() {... |
149 |
0
|
return genre; |
150 |
|
} |
151 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
152 |
202
|
public void setGenre(String genre) {... |
153 |
202
|
this.genre = genre; |
154 |
|
} |
155 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
156 |
0
|
public String getContentType() {... |
157 |
0
|
return contentType; |
158 |
|
} |
159 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
160 |
202
|
public void setContentType(String contentType) {... |
161 |
202
|
this.contentType = contentType; |
162 |
|
} |
163 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
164 |
397
|
public String getSuffix() {... |
165 |
397
|
return suffix; |
166 |
|
} |
167 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
168 |
272
|
public void setSuffix(String suffix) {... |
169 |
272
|
this.suffix = suffix; |
170 |
|
} |
171 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
172 |
0
|
public String getTranscodedContentType() {... |
173 |
0
|
return transcodedContentType; |
174 |
|
} |
175 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
176 |
202
|
public void setTranscodedContentType(String transcodedContentType) {... |
177 |
202
|
this.transcodedContentType = transcodedContentType; |
178 |
|
} |
179 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
180 |
397
|
public String getTranscodedSuffix() {... |
181 |
397
|
return transcodedSuffix; |
182 |
|
} |
183 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
184 |
202
|
public void setTranscodedSuffix(String transcodedSuffix) {... |
185 |
202
|
this.transcodedSuffix = transcodedSuffix; |
186 |
|
} |
187 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
188 |
0
|
public Long getSize() {... |
189 |
0
|
return size; |
190 |
|
} |
191 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
192 |
272
|
public void setSize(Long size) {... |
193 |
272
|
this.size = size; |
194 |
|
} |
195 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
196 |
443
|
public Integer getDuration() {... |
197 |
443
|
return duration; |
198 |
|
} |
199 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
200 |
202
|
public void setDuration(Integer duration) {... |
201 |
202
|
this.duration = duration; |
202 |
|
} |
203 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
204 |
476
|
public Integer getBitRate() {... |
205 |
476
|
return bitRate; |
206 |
|
} |
207 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
208 |
202
|
public void setBitRate(Integer bitRate) {... |
209 |
202
|
this.bitRate = bitRate; |
210 |
|
} |
211 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
212 |
232
|
public String getCoverArt() {... |
213 |
232
|
return coverArt; |
214 |
|
} |
215 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
216 |
333
|
public void setCoverArt(String coverArt) {... |
217 |
333
|
this.coverArt = coverArt; |
218 |
|
} |
219 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
220 |
649
|
public String getPath() {... |
221 |
649
|
return path; |
222 |
|
} |
223 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
224 |
272
|
public void setPath(String path) {... |
225 |
272
|
this.path = path; |
226 |
|
} |
227 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
228 |
277
|
public boolean isVideo() {... |
229 |
277
|
return video; |
230 |
|
} |
231 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
232 |
202
|
public void setVideo(boolean video) {... |
233 |
202
|
this.video = video; |
234 |
|
} |
235 |
|
|
|
|
| 80% |
Uncovered Elements: 2 (10) |
Complexity: 4 |
Complexity Density: 0,67 |
|
236 |
8073
|
@Override... |
237 |
|
public boolean equals(Object o) { |
238 |
8073
|
if (this == o) { |
239 |
653
|
return true; |
240 |
|
} |
241 |
7420
|
if (o == null || getClass() != o.getClass()) { |
242 |
0
|
return false; |
243 |
|
} |
244 |
|
|
245 |
7420
|
Entry entry = (Entry) o; |
246 |
7420
|
return id.equals(entry.id); |
247 |
|
} |
248 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
249 |
468
|
@Override... |
250 |
|
public int hashCode() { |
251 |
468
|
return id.hashCode(); |
252 |
|
} |
253 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
254 |
441
|
@Override... |
255 |
|
public String toString() { |
256 |
441
|
return title; |
257 |
|
} |
258 |
|
} |
259 |
|
} |