Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
Release |
|
| 1.6153846153846154;1.615 |
1 | /* | |
2 | =================== DO NOT EDIT THIS FILE ==================== | |
3 | Generated by Modello 1.0.1 on 2013-03-01 15:06:20, | |
4 | any modifications will be overwritten. | |
5 | ============================================================== | |
6 | */ | |
7 | ||
8 | package org.apache.maven.plugins.changes.model; | |
9 | ||
10 | /** | |
11 | * A single release of this project. | |
12 | * | |
13 | * @version $Revision$ $Date$ | |
14 | */ | |
15 | 24 | public class Release |
16 | implements java.io.Serializable | |
17 | { | |
18 | ||
19 | //--------------------------/ | |
20 | //- Class/Member Variables -/ | |
21 | //--------------------------/ | |
22 | ||
23 | /** | |
24 | * | |
25 | * The version number associated with this release. | |
26 | * | |
27 | */ | |
28 | private String version; | |
29 | ||
30 | /** | |
31 | * | |
32 | * | |
33 | * <p>The date of this release.</p> | |
34 | * <p>This field can be any String, such as "in | |
35 | * SVN" when the version isn't yet released. </p> | |
36 | * | |
37 | * | |
38 | */ | |
39 | private String dateRelease; | |
40 | ||
41 | /** | |
42 | * | |
43 | * A short description of this release. | |
44 | * | |
45 | */ | |
46 | private String description; | |
47 | ||
48 | /** | |
49 | * Field actions. | |
50 | */ | |
51 | private java.util.List<Action> actions; | |
52 | ||
53 | ||
54 | //-----------/ | |
55 | //- Methods -/ | |
56 | //-----------/ | |
57 | ||
58 | /** | |
59 | * Method addAction. | |
60 | * | |
61 | * @param action | |
62 | */ | |
63 | public void addAction( Action action ) | |
64 | { | |
65 | 0 | if ( !(action instanceof Action) ) |
66 | { | |
67 | 0 | throw new ClassCastException( "Release.addActions(action) parameter must be instanceof " + Action.class.getName() ); |
68 | } | |
69 | 0 | getActions().add( action ); |
70 | 0 | } //-- void addAction( Action ) |
71 | ||
72 | /** | |
73 | * Method getActions. | |
74 | * | |
75 | * @return List | |
76 | */ | |
77 | public java.util.List<Action> getActions() | |
78 | { | |
79 | 80 | if ( this.actions == null ) |
80 | { | |
81 | 14 | this.actions = new java.util.ArrayList<Action>(); |
82 | } | |
83 | ||
84 | 80 | return this.actions; |
85 | } //-- java.util.List<Action> getActions() | |
86 | ||
87 | /** | |
88 | * Get <p>The date of this release.</p> | |
89 | * <p>This field can be any String, such as "in | |
90 | * SVN" when the version isn't yet released. </p> | |
91 | * | |
92 | * @return String | |
93 | */ | |
94 | public String getDateRelease() | |
95 | { | |
96 | 26 | return this.dateRelease; |
97 | } //-- String getDateRelease() | |
98 | ||
99 | /** | |
100 | * Get a short description of this release. | |
101 | * | |
102 | * @return String | |
103 | */ | |
104 | public String getDescription() | |
105 | { | |
106 | 24 | return this.description; |
107 | } //-- String getDescription() | |
108 | ||
109 | /** | |
110 | * Get the version number associated with this release. | |
111 | * | |
112 | * @return String | |
113 | */ | |
114 | public String getVersion() | |
115 | { | |
116 | 146 | return this.version; |
117 | } //-- String getVersion() | |
118 | ||
119 | /** | |
120 | * Method removeAction. | |
121 | * | |
122 | * @param action | |
123 | */ | |
124 | public void removeAction( Action action ) | |
125 | { | |
126 | 0 | if ( !(action instanceof Action) ) |
127 | { | |
128 | 0 | throw new ClassCastException( "Release.removeActions(action) parameter must be instanceof " + Action.class.getName() ); |
129 | } | |
130 | 0 | getActions().remove( action ); |
131 | 0 | } //-- void removeAction( Action ) |
132 | ||
133 | /** | |
134 | * Set the list of actions taken for this release. | |
135 | * | |
136 | * @param actions | |
137 | */ | |
138 | public void setActions( java.util.List<Action> actions ) | |
139 | { | |
140 | 2 | this.actions = actions; |
141 | 2 | } //-- void setActions( java.util.List ) |
142 | ||
143 | /** | |
144 | * Set <p>The date of this release.</p> | |
145 | * <p>This field can be any String, such as "in | |
146 | * SVN" when the version isn't yet released. </p> | |
147 | * | |
148 | * @param dateRelease | |
149 | */ | |
150 | public void setDateRelease( String dateRelease ) | |
151 | { | |
152 | 10 | this.dateRelease = dateRelease; |
153 | 10 | } //-- void setDateRelease( String ) |
154 | ||
155 | /** | |
156 | * Set a short description of this release. | |
157 | * | |
158 | * @param description | |
159 | */ | |
160 | public void setDescription( String description ) | |
161 | { | |
162 | 8 | this.description = description; |
163 | 8 | } //-- void setDescription( String ) |
164 | ||
165 | /** | |
166 | * Set the version number associated with this release. | |
167 | * | |
168 | * @param version | |
169 | */ | |
170 | public void setVersion( String version ) | |
171 | { | |
172 | 20 | this.version = version; |
173 | 20 | } //-- void setVersion( String ) |
174 | ||
175 | ||
176 | public java.util.List getActions(String type) | |
177 | { | |
178 | 16 | java.util.List actions = new java.util.ArrayList(); |
179 | 16 | for (java.util.Iterator iterator = getActions().iterator(); iterator.hasNext(); ) |
180 | { | |
181 | 80 | Action action = (Action) iterator.next(); |
182 | 80 | if ( action.getType() != null && action.getType().equalsIgnoreCase( type ) ) |
183 | { | |
184 | 20 | actions.add( action ); |
185 | } | |
186 | 80 | } |
187 | 16 | return actions; |
188 | } | |
189 | ||
190 | 24 | private final java.util.List components = new java.util.ArrayList(); |
191 | ||
192 | public void addComponent(String name, Release release) | |
193 | { | |
194 | 0 | final Component component = new Component(); |
195 | 0 | component.setName(name); |
196 | 0 | component.setDescription(release.getDescription()); |
197 | 0 | component.setActions(release.getActions()); |
198 | 0 | components.add(component); |
199 | 0 | } |
200 | ||
201 | public java.util.List getComponents() | |
202 | { | |
203 | 0 | return components; |
204 | } | |
205 | ||
206 | } |