1
2
3
4
5
6
7
8 package org.apache.maven.plugins.changes.model;
9
10
11
12
13
14
15 public class Release
16 implements java.io.Serializable
17 {
18
19
20
21
22
23
24
25
26
27
28 private String version;
29
30
31
32
33
34
35
36
37
38
39
40 private String dateRelease;
41
42
43
44
45
46
47 private String description;
48
49
50
51
52 private java.util.List<Action> actions;
53
54
55
56
57
58
59
60
61
62
63
64 public void addAction( Action action )
65 {
66 if ( !(action instanceof Action) )
67 {
68 throw new ClassCastException( "Release.addActions(action) parameter must be instanceof " + Action.class.getName() );
69 }
70 getActions().add( action );
71 }
72
73
74
75
76
77
78 public java.util.List<Action> getActions()
79 {
80 if ( this.actions == null )
81 {
82 this.actions = new java.util.ArrayList<Action>();
83 }
84
85 return this.actions;
86 }
87
88
89
90
91
92
93
94
95
96 public String getDateRelease()
97 {
98 return this.dateRelease;
99 }
100
101
102
103
104
105
106 public String getDescription()
107 {
108 return this.description;
109 }
110
111
112
113
114
115
116 public String getVersion()
117 {
118 return this.version;
119 }
120
121
122
123
124
125
126 public void removeAction( Action action )
127 {
128 if ( !(action instanceof Action) )
129 {
130 throw new ClassCastException( "Release.removeActions(action) parameter must be instanceof " + Action.class.getName() );
131 }
132 getActions().remove( action );
133 }
134
135
136
137
138
139
140 public void setActions( java.util.List<Action> actions )
141 {
142 this.actions = actions;
143 }
144
145
146
147
148
149
150
151
152
153 public void setDateRelease( String dateRelease )
154 {
155 this.dateRelease = dateRelease;
156 }
157
158
159
160
161
162
163 public void setDescription( String description )
164 {
165 this.description = description;
166 }
167
168
169
170
171
172
173 public void setVersion( String version )
174 {
175 this.version = version;
176 }
177
178
179 public java.util.List<Action> getActions(String type)
180 {
181 java.util.List<Action> actions = new java.util.ArrayList<Action>();
182 for (Action action : getActions())
183 {
184 if ( action.getType() != null && action.getType().equalsIgnoreCase( type ) )
185 {
186 actions.add( action );
187 }
188 }
189 return actions;
190 }
191
192 private final java.util.List<Component> components = new java.util.ArrayList<Component>();
193
194 public void addComponent(String name, Release release)
195 {
196 final Component component = new Component();
197 component.setName(name);
198 component.setDescription(release.getDescription());
199 component.setActions(release.getActions());
200 components.add(component);
201 }
202
203 public java.util.List<Component> getComponents()
204 {
205 return components;
206 }
207
208 }