1 | |
package org.apache.maven.plugin.changes; |
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
|
19 | |
|
20 | |
|
21 | |
|
22 | |
import java.util.ArrayList; |
23 | |
import java.util.List; |
24 | |
import java.util.Iterator; |
25 | |
|
26 | |
|
27 | |
|
28 | |
|
29 | |
|
30 | |
|
31 | |
public class Release |
32 | |
{ |
33 | |
public static final String ADD_ACTION = "add"; |
34 | |
|
35 | |
public static final String FIX_ACTION = "fix"; |
36 | |
|
37 | |
public static final String UPDATE_ACTION = "update"; |
38 | |
|
39 | |
public static final String REMOVE_ACTION = "remove"; |
40 | |
|
41 | |
|
42 | |
private List action; |
43 | |
|
44 | |
private String dateRelease; |
45 | |
|
46 | |
private String description; |
47 | |
|
48 | |
private String version; |
49 | |
|
50 | |
public Release() |
51 | 6 | { |
52 | 6 | } |
53 | |
|
54 | |
public void setAction( List action ) |
55 | |
{ |
56 | 2 | this.action = action; |
57 | 2 | } |
58 | |
|
59 | |
public List getAction() |
60 | |
{ |
61 | 2 | if ( action == null ) |
62 | |
{ |
63 | 0 | action = new ArrayList(); |
64 | |
} |
65 | 2 | return action; |
66 | |
} |
67 | |
|
68 | |
public void addAction( Action act ) |
69 | |
{ |
70 | 0 | if ( action == null ) |
71 | |
{ |
72 | 0 | action = new ArrayList(); |
73 | |
} |
74 | 0 | action.add( act ); |
75 | 0 | } |
76 | |
|
77 | |
public void setDateRelease( String dateRelease ) |
78 | |
{ |
79 | 2 | this.dateRelease = dateRelease; |
80 | 2 | } |
81 | |
|
82 | |
public String getDateRelease() |
83 | |
{ |
84 | 2 | return dateRelease; |
85 | |
} |
86 | |
|
87 | |
public void setDescription( String description ) |
88 | |
{ |
89 | 0 | this.description = description; |
90 | 0 | } |
91 | |
|
92 | |
public String getDescription() |
93 | |
{ |
94 | 0 | return description; |
95 | |
} |
96 | |
|
97 | |
public void setVersion( String version ) |
98 | |
{ |
99 | 2 | this.version = version; |
100 | 2 | } |
101 | |
|
102 | |
public String getVersion() |
103 | |
{ |
104 | 2 | return version; |
105 | |
} |
106 | |
|
107 | |
|
108 | |
|
109 | |
|
110 | |
|
111 | |
|
112 | |
|
113 | |
public List getActions( final String actionType ) |
114 | |
{ |
115 | 0 | final List result = new ArrayList(); |
116 | 0 | if ( getAction() == null ) |
117 | |
{ |
118 | 0 | return new ArrayList(); |
119 | |
} |
120 | 0 | final Iterator it = getAction().iterator(); |
121 | 0 | while ( it.hasNext() ) |
122 | |
{ |
123 | 0 | Action action = (Action) it.next(); |
124 | 0 | if ( actionType.equals( action.getType() ) ) |
125 | |
{ |
126 | 0 | result.add( action ); |
127 | |
} |
128 | |
} |
129 | |
|
130 | 0 | return result; |
131 | |
} |
132 | |
} |