View Javadoc

1   /*
2    =================== DO NOT EDIT THIS FILE ====================
3    Generated by Modello 1.1 on 2011-09-18 11:21:46,
4    any modifications will be overwritten.
5    ==============================================================
6    */
7   
8   package org.apache.maven.continuum.model.scm;
9   
10    //---------------------------------/
11   //- Imported classes and packages -/
12  //---------------------------------/
13  
14  import org.apache.continuum.model.project.ProjectScmRoot;
15  import org.apache.continuum.model.release.ContinuumReleaseResult;
16  import org.apache.continuum.model.repository.AbstractPurgeConfiguration;
17  import org.apache.continuum.model.repository.DirectoryPurgeConfiguration;
18  import org.apache.continuum.model.repository.LocalRepository;
19  import org.apache.continuum.model.repository.RepositoryPurgeConfiguration;
20  import org.apache.maven.continuum.model.project.BuildDefinition;
21  import org.apache.maven.continuum.model.project.BuildDefinitionTemplate;
22  import org.apache.maven.continuum.model.project.BuildQueue;
23  import org.apache.maven.continuum.model.project.BuildResult;
24  import org.apache.maven.continuum.model.project.ContinuumDatabase;
25  import org.apache.maven.continuum.model.project.Project;
26  import org.apache.maven.continuum.model.project.ProjectDependency;
27  import org.apache.maven.continuum.model.project.ProjectDeveloper;
28  import org.apache.maven.continuum.model.project.ProjectGroup;
29  import org.apache.maven.continuum.model.project.ProjectNotifier;
30  import org.apache.maven.continuum.model.project.Schedule;
31  import org.apache.maven.continuum.model.system.Installation;
32  import org.apache.maven.continuum.model.system.NotificationAddress;
33  import org.apache.maven.continuum.model.system.Profile;
34  import org.apache.maven.continuum.model.system.SystemConfiguration;
35  import org.apache.maven.continuum.project.ContinuumProjectState;
36  
37  /**
38   * Class ChangeSet.
39   * 
40   * @version $Revision$ $Date$
41   */
42  @SuppressWarnings( "all" )
43  public class ChangeSet
44      implements java.io.Serializable
45  {
46  
47        //--------------------------/
48       //- Class/Member Variables -/
49      //--------------------------/
50  
51      /**
52       * Field id.
53       */
54      private String id;
55  
56      /**
57       * Field author.
58       */
59      private String author;
60  
61      /**
62       * Field comment.
63       */
64      private String comment;
65  
66      /**
67       * Field date.
68       */
69      private long date = 0L;
70  
71      /**
72       * Field files.
73       */
74      private java.util.List<ChangeFile> files;
75  
76  
77        //-----------/
78       //- Methods -/
79      //-----------/
80  
81      /**
82       * Method addFile.
83       * 
84       * @param changeFile
85       */
86      public void addFile( ChangeFile changeFile )
87      {
88          getFiles().add( changeFile );
89      } //-- void addFile( ChangeFile )
90  
91      /**
92       * Get the author field.
93       * 
94       * @return String
95       */
96      public String getAuthor()
97      {
98          return this.author;
99      } //-- String getAuthor()
100 
101     /**
102      * Get the comment field.
103      * 
104      * @return String
105      */
106     public String getComment()
107     {
108         return this.comment;
109     } //-- String getComment()
110 
111     /**
112      * Get the date field.
113      * 
114      * @return long
115      */
116     public long getDate()
117     {
118         return this.date;
119     } //-- long getDate()
120 
121     /**
122      * Method getFiles.
123      * 
124      * @return List
125      */
126     public java.util.List<ChangeFile> getFiles()
127     {
128         if ( this.files == null )
129         {
130             this.files = new java.util.ArrayList<ChangeFile>();
131         }
132 
133         return this.files;
134     } //-- java.util.List<ChangeFile> getFiles()
135 
136     /**
137      * Get the id field.
138      * 
139      * @return String
140      */
141     public String getId()
142     {
143         return this.id;
144     } //-- String getId()
145 
146     /**
147      * Method removeFile.
148      * 
149      * @param changeFile
150      */
151     public void removeFile( ChangeFile changeFile )
152     {
153         getFiles().remove( changeFile );
154     } //-- void removeFile( ChangeFile )
155 
156     /**
157      * Set the author field.
158      * 
159      * @param author
160      */
161     public void setAuthor( String author )
162     {
163         this.author = author;
164     } //-- void setAuthor( String )
165 
166     /**
167      * Set the comment field.
168      * 
169      * @param comment
170      */
171     public void setComment( String comment )
172     {
173         this.comment = comment;
174     } //-- void setComment( String )
175 
176     /**
177      * Set the date field.
178      * 
179      * @param date
180      */
181     public void setDate( long date )
182     {
183         this.date = date;
184     } //-- void setDate( long )
185 
186     /**
187      * Set the files field.
188      * 
189      * @param files
190      */
191     public void setFiles( java.util.List<ChangeFile> files )
192     {
193         this.files = files;
194     } //-- void setFiles( java.util.List )
195 
196     /**
197      * Set the id field.
198      * 
199      * @param id
200      */
201     public void setId( String id )
202     {
203         this.id = id;
204     } //-- void setId( String )
205 
206     
207             /**
208              * @return Returns string representation of the changeset
209              */
210             public String toString()
211             {
212                 StringBuilder result = new StringBuilder();
213                 if ( author != null )
214                 {
215                     result.append( author ).append( "\n" );
216                 }
217                 result.append( date ).append( "\n" );
218 
219                 if ( files != null )
220                 {
221                     for ( java.util.Iterator i = files.iterator(); i.hasNext(); )
222                     {
223                         ChangeFile file = (ChangeFile) i.next();
224                         
225                         if (file != null)
226                         {
227                             result.append( file ).append( "\n" );
228                         }
229                     }
230                 }
231 
232                 if ( comment != null )
233                 {
234                     result.append( comment );
235                 }
236 
237                 return result.toString();
238             }
239 
240             /**
241              * @see java.lang.Object#equals(java.lang.Object)
242              */
243             public boolean equals( Object obj )
244             {
245                 if ( obj instanceof ChangeSet )
246                 {
247                     ChangeSet changeSet = (ChangeSet) obj;
248 
249                     if ( toString().equals( changeSet.toString() ) )
250                     {
251                         return true;
252                     }
253                 }
254 
255                 return false;
256             }
257 
258             public java.util.Date getDateAsDate()
259             {
260                 if ( date > 0 )
261                 {
262                     return new java.util.Date( date );
263                 }
264 
265                 return null;
266             }
267           
268 }