Clover Coverage Report - itracker
Coverage timestamp: Tue May 1 2012 16:42:12 CEST
17   149   14   1.42
4   69   0.82   6
12     1.17  
2    
 
 
  IssueRelation       Line # 28 16 13 0% 0.0
  IssueRelation.Type       Line # 108 1 1 0% 0.0
 
No Tests
 
1    /*
2    * This software was designed and created by Jason Carroll.
3    * Copyright (c) 2002, 2003, 2004 Jason Carroll.
4    * The author can be reached at jcarroll@cowsultants.com
5    * ITracker website: http://www.cowsultants.com
6    * ITracker forums: http://www.cowsultants.com/phpBB/index.php
7    *
8    * This program is free software; you can redistribute it and/or modify
9    * it only under the terms of the GNU General Public License as published by
10    * the Free Software Foundation; either version 2 of the License, or
11    * (at your option) any later version.
12    *
13    * This program is distributed in the hope that it will be useful,
14    * but WITHOUT ANY WARRANTY; without even the implied warranty of
15    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16    * GNU General Public License for more details.
17    */
18   
19    package org.itracker.model;
20   
21    import org.apache.commons.lang.builder.ToStringBuilder;
22   
23    /**
24    * A relation between issues.
25    *
26    * @author ready
27    */
 
28    public class IssueRelation extends AbstractEntity {
29   
30    /**
31    *
32    */
33    private static final long serialVersionUID = 1L;
34   
35    private Issue issue;
36   
37    private Issue relatedIssue;
38   
39    /** Indicates the kind of relation that exists between the 2 issues. */
40    private int type;
41   
42    private Integer matchingRelationId;
43   
44    /**
45    * Default constructor (required by Hibernate).
46    *
47    * <p>
48    * PENDING: should be <code>private</code> so that it can only be used by
49    * Hibernate, to ensure that the fields which form an instance's identity
50    * are always initialized/never <tt>null</tt>.
51    * </p>
52    */
 
53  0 toggle public IssueRelation() {
54    }
55   
 
56  0 toggle public IssueRelation(Issue issue, Issue relatedIssue, int relationType) {
57  0 setIssue(issue);
58  0 setRelatedIssue(relatedIssue);
59  0 setRelationType(relationType);
60    }
61   
 
62  0 toggle public Issue getIssue() {
63  0 return issue;
64    }
65   
 
66  0 toggle public void setIssue(Issue issue) {
67  0 if (issue == null) {
68  0 throw new IllegalArgumentException("null issue");
69    }
70  0 this.issue = issue;
71    }
72   
 
73  0 toggle public Issue getRelatedIssue() {
74  0 return relatedIssue;
75    }
76   
 
77  0 toggle public void setRelatedIssue(Issue relatedIssue) {
78  0 if (relatedIssue == null) {
79  0 throw new IllegalArgumentException("null relatedIssue");
80    }
81  0 this.relatedIssue = relatedIssue;
82    }
83   
 
84  0 toggle public int getRelationType() {
85  0 return type;
86    }
87   
 
88  0 toggle public void setRelationType(int type) {
89  0 this.type = type;
90    }
91   
 
92  0 toggle public Integer getMatchingRelationId() {
93  0 return matchingRelationId;
94    }
95   
 
96  0 toggle public void setMatchingRelationId(Integer matchingRelationId) {
97  0 this.matchingRelationId = matchingRelationId;
98    }
99   
100   
 
101  0 toggle @Override
102    public String toString() {
103  0 return new ToStringBuilder(this).append("id", getId())
104    .append("issue", getIssue()).append("relatedIssue", getRelatedIssue())
105    .append("type", getRelationType()).toString();
106    }
107   
 
108    public static enum Type {
109   
110    /** Defines a related issue. Sample text: related to */
111    RELATED_P(1),
112   
113    /** Defines a related issue. Sample text: related to */
114    RELATED_C(2),
115   
116    /** Defines a duplicate issue. Sample text: duplicates */
117    DUPLICATE_P(3),
118   
119    /** Defines a duplicate issue. Sample text: duplicate of */
120    DUPLICATE_C(4),
121   
122    /** Defines a cloned issue. Sample text: cloned to */
123    CLONED_P(5),
124   
125    /** Defines a cloned issue. Sample text: cloned from */
126    CLONED_C(6),
127   
128    /** Defines a split issue. Sample text: split to */
129    SPLIT_P(7),
130   
131    /** Defines a split issue. Sample text: split from */
132    SPLIT_C(8),
133   
134    /** Defines a dependent issue. Sample text: dependents */
135    DEPENDENT_P(9),
136   
137    /** Defines a dependent issue. Sample text: depends on */
138    DEPENDENT_C(10);
139   
140    @SuppressWarnings("unused")
141    private final int code;
142   
 
143  0 toggle private Type(int code) {
144  0 this.code = code;
145    }
146   
147    }
148   
149    }