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.v1_0_9;
9   
10    //---------------------------------/
11   //- Imported classes and packages -/
12  //---------------------------------/
13  
14  import org.apache.maven.continuum.model.project.v1_0_9.BuildDefinition;
15  import org.apache.maven.continuum.model.project.v1_0_9.BuildResult;
16  import org.apache.maven.continuum.model.project.v1_0_9.ContinuumDatabase;
17  import org.apache.maven.continuum.model.project.v1_0_9.Project;
18  import org.apache.maven.continuum.model.project.v1_0_9.ProjectDependency;
19  import org.apache.maven.continuum.model.project.v1_0_9.ProjectDeveloper;
20  import org.apache.maven.continuum.model.project.v1_0_9.ProjectGroup;
21  import org.apache.maven.continuum.model.project.v1_0_9.ProjectNotifier;
22  import org.apache.maven.continuum.model.project.v1_0_9.Schedule;
23  import org.apache.maven.continuum.model.system.v1_0_9.NotificationAddress;
24  import org.apache.maven.continuum.model.system.v1_0_9.SystemConfiguration;
25  
26  /**
27   * Class ChangeSet.
28   * 
29   * @version $Revision$ $Date$
30   */
31  @SuppressWarnings( "all" )
32  public class ChangeSet
33      implements java.io.Serializable
34  {
35  
36        //--------------------------/
37       //- Class/Member Variables -/
38      //--------------------------/
39  
40      /**
41       * Field author.
42       */
43      private String author;
44  
45      /**
46       * Field comment.
47       */
48      private String comment;
49  
50      /**
51       * Field date.
52       */
53      private long date = 0L;
54  
55      /**
56       * Field files.
57       */
58      private java.util.List<ChangeFile> files;
59  
60  
61        //-----------/
62       //- Methods -/
63      //-----------/
64  
65      /**
66       * Method addFile.
67       * 
68       * @param changeFile
69       */
70      public void addFile( ChangeFile changeFile )
71      {
72          getFiles().add( changeFile );
73      } //-- void addFile( ChangeFile )
74  
75      /**
76       * Get the author field.
77       * 
78       * @return String
79       */
80      public String getAuthor()
81      {
82          return this.author;
83      } //-- String getAuthor()
84  
85      /**
86       * Get the comment field.
87       * 
88       * @return String
89       */
90      public String getComment()
91      {
92          return this.comment;
93      } //-- String getComment()
94  
95      /**
96       * Get the date field.
97       * 
98       * @return long
99       */
100     public long getDate()
101     {
102         return this.date;
103     } //-- long getDate()
104 
105     /**
106      * Method getFiles.
107      * 
108      * @return List
109      */
110     public java.util.List<ChangeFile> getFiles()
111     {
112         if ( this.files == null )
113         {
114             this.files = new java.util.ArrayList<ChangeFile>();
115         }
116 
117         return this.files;
118     } //-- java.util.List<ChangeFile> getFiles()
119 
120     /**
121      * Method removeFile.
122      * 
123      * @param changeFile
124      */
125     public void removeFile( ChangeFile changeFile )
126     {
127         getFiles().remove( changeFile );
128     } //-- void removeFile( ChangeFile )
129 
130     /**
131      * Set the author field.
132      * 
133      * @param author
134      */
135     public void setAuthor( String author )
136     {
137         this.author = author;
138     } //-- void setAuthor( String )
139 
140     /**
141      * Set the comment field.
142      * 
143      * @param comment
144      */
145     public void setComment( String comment )
146     {
147         this.comment = comment;
148     } //-- void setComment( String )
149 
150     /**
151      * Set the date field.
152      * 
153      * @param date
154      */
155     public void setDate( long date )
156     {
157         this.date = date;
158     } //-- void setDate( long )
159 
160     /**
161      * Set the files field.
162      * 
163      * @param files
164      */
165     public void setFiles( java.util.List<ChangeFile> files )
166     {
167         this.files = files;
168     } //-- void setFiles( java.util.List )
169 
170     
171             /**
172              * @return Returns string representation of the changeset
173              */
174             public String toString()
175             {
176                 String result = author + "\n" + date + "\n";
177 
178                 if ( files != null )
179                 {
180                     for ( java.util.Iterator i = files.iterator(); i.hasNext(); )
181                     {
182                         ChangeFile file = (ChangeFile) i.next();
183 
184                         result += file + "\n";
185                     }
186                 }
187 
188                 result += comment;
189 
190                 return result;
191             }
192 
193             /**
194              * @see java.lang.Object#equals(java.lang.Object)
195              */
196             public boolean equals( Object obj )
197             {
198                 if ( obj instanceof ChangeSet )
199                 {
200                     ChangeSet changeSet = (ChangeSet) obj;
201 
202                     if ( toString().equals( changeSet.toString() ) )
203                     {
204                         return true;
205                     }
206                 }
207 
208                 return false;
209             }
210 
211             public java.util.Date getDateAsDate()
212             {
213                 if ( date > 0 )
214                 {
215                     return new java.util.Date( date );
216                 }
217 
218                 return null;
219             }
220           
221 }