Clover Coverage Report - itracker
Coverage timestamp: Tue May 1 2012 16:42:12 CEST
11   67   8   1.83
2   35   0.73   6
6     1.33  
1    
 
 
  ListAttachmentsPTO       Line # 17 11 8 0% 0.0
 
No Tests
 
1    /**
2    *
3    */
4    package org.itracker.web.ptos;
5   
6    import java.util.ArrayList;
7    import java.util.Collections;
8    import java.util.List;
9   
10    import org.itracker.model.IssueAttachment;
11   
12    /**
13    * Class represents ListAttachmentsPTO.
14    *
15    * @author Anton Kozak
16    */
 
17    public class ListAttachmentsPTO {
18    boolean hasAttachments = false;
19    long sizeOfAllAttachments = 0;
20    List<IssueAttachment> attachments = new ArrayList<IssueAttachment>();
21   
22    /**
23    * @return the hasAttachments
24    */
 
25  0 toggle public boolean isHasAttachments() {
26  0 return hasAttachments;
27    }
28    /**
29    * @param hasAttachments the hasAttachments to set
30    */
 
31  0 toggle public void setHasAttachments(boolean hasAttachments) {
32  0 this.hasAttachments = hasAttachments;
33    }
34    /**
35    * @return the sizeOfAllAttachments
36    */
 
37  0 toggle public long getSizeOfAllAttachments() {
38  0 return sizeOfAllAttachments;
39    }
40    /**
41    * @param sizeOfAllAttachments the sizeOfAllAttachments to set
42    */
 
43  0 toggle public void setSizeOfAllAttachments(long sizeOfAllAttachments) {
44  0 this.sizeOfAllAttachments = sizeOfAllAttachments;
45    }
46    /**
47    * @return the attachments
48    */
 
49  0 toggle public List<IssueAttachment> getAttachments() {
50  0 return attachments;
51    }
52    /**
53    * @param attachments the attachments to set
54    */
 
55  0 toggle public void setAttachments(List<IssueAttachment> attachments) {
56  0 this.attachments = attachments;
57  0 if( attachments.size() > 0 ) {
58  0 hasAttachments = true;
59  0 Collections.sort(attachments, IssueAttachment.ID_COMPARATOR);
60  0 for (IssueAttachment issueAttachment : attachments) {
61  0 sizeOfAllAttachments += issueAttachment.getSize();
62    }
63    }
64    }
65   
66   
67    }