View Javadoc
1   /*
2    =================== DO NOT EDIT THIS FILE ====================
3    Generated by Modello 1.0.1 on 2016-10-29 20:36:58,
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  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       *             The date of this release.
34       *             <p>This field can be any string, such as "in
35       * SVN" when the version isn't yet released but the ISO 8601
36       * date format is recommended.</p>
37       *           
38       *           
39       */
40      private String dateRelease;
41  
42      /**
43       * 
44       *             A short description of this release.
45       *           
46       */
47      private String description;
48  
49      /**
50       * Field actions.
51       */
52      private java.util.List<Action> actions;
53  
54  
55        //-----------/
56       //- Methods -/
57      //-----------/
58  
59      /**
60       * Method addAction.
61       * 
62       * @param action
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      } //-- void addAction( Action )
72  
73      /**
74       * Method getActions.
75       * 
76       * @return List
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      } //-- java.util.List<Action> getActions()
87  
88      /**
89       * Get the date of this release.
90       *             <p>This field can be any string, such as "in
91       * SVN" when the version isn't yet released but the ISO 8601
92       * date format is recommended.</p>
93       * 
94       * @return String
95       */
96      public String getDateRelease()
97      {
98          return this.dateRelease;
99      } //-- String getDateRelease()
100 
101     /**
102      * Get a short description of this release.
103      * 
104      * @return String
105      */
106     public String getDescription()
107     {
108         return this.description;
109     } //-- String getDescription()
110 
111     /**
112      * Get the version number associated with this release.
113      * 
114      * @return String
115      */
116     public String getVersion()
117     {
118         return this.version;
119     } //-- String getVersion()
120 
121     /**
122      * Method removeAction.
123      * 
124      * @param action
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     } //-- void removeAction( Action )
134 
135     /**
136      * Set the list of actions taken for this release.
137      * 
138      * @param actions
139      */
140     public void setActions( java.util.List<Action> actions )
141     {
142         this.actions = actions;
143     } //-- void setActions( java.util.List )
144 
145     /**
146      * Set the date of this release.
147      *             <p>This field can be any string, such as "in
148      * SVN" when the version isn't yet released but the ISO 8601
149      * date format is recommended.</p>
150      * 
151      * @param dateRelease
152      */
153     public void setDateRelease( String dateRelease )
154     {
155         this.dateRelease = dateRelease;
156     } //-- void setDateRelease( String )
157 
158     /**
159      * Set a short description of this release.
160      * 
161      * @param description
162      */
163     public void setDescription( String description )
164     {
165         this.description = description;
166     } //-- void setDescription( String )
167 
168     /**
169      * Set the version number associated with this release.
170      * 
171      * @param version
172      */
173     public void setVersion( String version )
174     {
175         this.version = version;
176     } //-- void setVersion( String )
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 }