Clover Coverage Report - Subsonic-Android Coverage Report
Coverage timestamp: ven dic 19 2014 17:57:13 EST
../../../../../img/srcFileCovDistChart8.png 45% of files have more coverage
57   259   55   1,24
8   185   0,96   23
46     1,2  
2    
This report was generated with an evaluation server license. Purchase Clover or configure your license.
 
  MusicDirectory       Line # 28 11 11 50% 0.5
  MusicDirectory.Entry       Line # 63 46 44 86,8% 0.8681319
 
No Tests
 
1    /*
2    This file is part of Subsonic.
3   
4    Subsonic is free software: you can redistribute it and/or modify
5    it under the terms of the GNU General Public License as published by
6    the Free Software Foundation, either version 3 of the License, or
7    (at your option) any later version.
8   
9    Subsonic is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12    GNU General Public License for more details.
13   
14    You should have received a copy of the GNU General Public License
15    along with Subsonic. If not, see <http://www.gnu.org/licenses/>.
16   
17    Copyright 2009 (C) Sindre Mehus
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 Sindre Mehus
27    */
 
28    public class MusicDirectory {
29   
30    private String name;
31    private final List<Entry> children = new ArrayList<Entry>();
32   
 
33  0 toggle public String getName() {
34  0 return name;
35    }
36   
 
37  5 toggle public void setName(String name) {
38  5 this.name = name;
39    }
40   
 
41  332 toggle public void addChild(Entry child) {
42  332 children.add(child);
43    }
44   
 
45  27 toggle public List<Entry> getChildren() {
46  27 return getChildren(true, true);
47    }
48   
 
49  27 toggle 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   
 
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   
 
84  98 toggle public String getId() {
85  98 return id;
86    }
87   
 
88  333 toggle public void setId(String id) {
89  333 this.id = id;
90    }
91   
 
92  5 toggle public String getParent() {
93  5 return parent;
94    }
95   
 
96  333 toggle public void setParent(String parent) {
97  333 this.parent = parent;
98    }
99   
 
100  1025 toggle public boolean isDirectory() {
101  1025 return directory;
102    }
103   
 
104  333 toggle public void setDirectory(boolean directory) {
105  333 this.directory = directory;
106    }
107   
 
108  533 toggle public String getTitle() {
109  533 return title;
110    }
111   
 
112  333 toggle public void setTitle(String title) {
113  333 this.title = title;
114    }
115   
 
116  119 toggle public String getAlbum() {
117  119 return album;
118    }
119   
 
120  272 toggle public void setAlbum(String album) {
121  272 this.album = album;
122    }
123   
 
124  412 toggle public String getArtist() {
125  412 return artist;
126    }
127   
 
128  333 toggle public void setArtist(String artist) {
129  333 this.artist = artist;
130    }
131   
 
132  164 toggle public Integer getTrack() {
133  164 return track;
134    }
135   
 
136  202 toggle public void setTrack(Integer track) {
137  202 this.track = track;
138    }
139   
 
140  0 toggle public Integer getYear() {
141  0 return year;
142    }
143   
 
144  202 toggle public void setYear(Integer year) {
145  202 this.year = year;
146    }
147   
 
148  0 toggle public String getGenre() {
149  0 return genre;
150    }
151   
 
152  202 toggle public void setGenre(String genre) {
153  202 this.genre = genre;
154    }
155   
 
156  0 toggle public String getContentType() {
157  0 return contentType;
158    }
159   
 
160  202 toggle public void setContentType(String contentType) {
161  202 this.contentType = contentType;
162    }
163   
 
164  397 toggle public String getSuffix() {
165  397 return suffix;
166    }
167   
 
168  272 toggle public void setSuffix(String suffix) {
169  272 this.suffix = suffix;
170    }
171   
 
172  0 toggle public String getTranscodedContentType() {
173  0 return transcodedContentType;
174    }
175   
 
176  202 toggle public void setTranscodedContentType(String transcodedContentType) {
177  202 this.transcodedContentType = transcodedContentType;
178    }
179   
 
180  397 toggle public String getTranscodedSuffix() {
181  397 return transcodedSuffix;
182    }
183   
 
184  202 toggle public void setTranscodedSuffix(String transcodedSuffix) {
185  202 this.transcodedSuffix = transcodedSuffix;
186    }
187   
 
188  0 toggle public Long getSize() {
189  0 return size;
190    }
191   
 
192  272 toggle public void setSize(Long size) {
193  272 this.size = size;
194    }
195   
 
196  443 toggle public Integer getDuration() {
197  443 return duration;
198    }
199   
 
200  202 toggle public void setDuration(Integer duration) {
201  202 this.duration = duration;
202    }
203   
 
204  476 toggle public Integer getBitRate() {
205  476 return bitRate;
206    }
207   
 
208  202 toggle public void setBitRate(Integer bitRate) {
209  202 this.bitRate = bitRate;
210    }
211   
 
212  232 toggle public String getCoverArt() {
213  232 return coverArt;
214    }
215   
 
216  333 toggle public void setCoverArt(String coverArt) {
217  333 this.coverArt = coverArt;
218    }
219   
 
220  649 toggle public String getPath() {
221  649 return path;
222    }
223   
 
224  272 toggle public void setPath(String path) {
225  272 this.path = path;
226    }
227   
 
228  277 toggle public boolean isVideo() {
229  277 return video;
230    }
231   
 
232  202 toggle public void setVideo(boolean video) {
233  202 this.video = video;
234    }
235   
 
236  8073 toggle @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   
 
249  468 toggle @Override
250    public int hashCode() {
251  468 return id.hashCode();
252    }
253   
 
254  441 toggle @Override
255    public String toString() {
256  441 return title;
257    }
258    }
259    }