View Javadoc

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