1   
2   
3   
4   
5   
6   
7   
8   package org.apache.maven.continuum.xmlrpc.project;
9   
10    
11   
12  
13  
14  import org.apache.continuum.xmlrpc.release.ContinuumReleaseResult;
15  import org.apache.continuum.xmlrpc.repository.AbstractPurgeConfiguration;
16  import org.apache.continuum.xmlrpc.repository.DirectoryPurgeConfiguration;
17  import org.apache.continuum.xmlrpc.repository.LocalRepository;
18  import org.apache.continuum.xmlrpc.repository.RepositoryPurgeConfiguration;
19  import org.apache.continuum.xmlrpc.utils.BuildTrigger;
20  import org.apache.maven.continuum.xmlrpc.scm.ChangeFile;
21  import org.apache.maven.continuum.xmlrpc.scm.ChangeSet;
22  import org.apache.maven.continuum.xmlrpc.scm.ScmResult;
23  import org.apache.maven.continuum.xmlrpc.system.Installation;
24  import org.apache.maven.continuum.xmlrpc.system.Profile;
25  import org.apache.maven.continuum.xmlrpc.system.SystemConfiguration;
26  
27  
28  
29  
30  
31  
32  
33  
34  @SuppressWarnings( "all" )
35  public class AddingResult
36      implements java.io.Serializable
37  {
38  
39        
40       
41      
42  
43      
44  
45  
46      private java.util.List<ProjectSummary> projects;
47  
48      
49  
50  
51      private java.util.List<ProjectGroupSummary> projectGroups;
52  
53  
54        
55       
56      
57  
58      
59  
60  
61  
62  
63      public void addProject( ProjectSummary projectSummary )
64      {
65          getProjects().add( projectSummary );
66      } 
67  
68      
69  
70  
71  
72  
73      public void addProjectGroup( ProjectGroupSummary projectGroupSummary )
74      {
75          getProjectGroups().add( projectGroupSummary );
76      } 
77  
78      
79  
80  
81  
82  
83      public java.util.List<ProjectGroupSummary> getProjectGroups()
84      {
85          if ( this.projectGroups == null )
86          {
87              this.projectGroups = new java.util.ArrayList<ProjectGroupSummary>();
88          }
89  
90          return this.projectGroups;
91      } 
92  
93      
94  
95  
96  
97  
98      public java.util.List<ProjectSummary> getProjects()
99      {
100         if ( this.projects == null )
101         {
102             this.projects = new java.util.ArrayList<ProjectSummary>();
103         }
104 
105         return this.projects;
106     } 
107 
108     
109 
110 
111 
112 
113     public void removeProject( ProjectSummary projectSummary )
114     {
115         getProjects().remove( projectSummary );
116     } 
117 
118     
119 
120 
121 
122 
123     public void removeProjectGroup( ProjectGroupSummary projectGroupSummary )
124     {
125         getProjectGroups().remove( projectGroupSummary );
126     } 
127 
128     
129 
130 
131 
132 
133     public void setProjectGroups( java.util.List<ProjectGroupSummary> projectGroups )
134     {
135         this.projectGroups = projectGroups;
136     } 
137 
138     
139 
140 
141 
142 
143     public void setProjects( java.util.List<ProjectSummary> projects )
144     {
145         this.projects = projects;
146     } 
147 
148     
149             private java.util.List errors = new java.util.ArrayList();
150 
151             
152 
153 
154 
155 
156             public void addError( String errorKey )
157             {
158                 errors.add( errorKey );
159             }
160 
161             
162 
163 
164 
165 
166 
167             public java.util.List getErrors()
168             {
169                 return errors;
170             }
171 
172             
173 
174 
175 
176 
177             public boolean hasErrors()
178             {
179                 return ( errors != null ) && ( !errors.isEmpty() );
180             }
181 
182             
183 
184 
185 
186 
187             public String getErrorsAsString()
188             {
189                 if ( !hasErrors() )
190                 {
191                     return null;
192                 }
193 
194                 StringBuffer message = new StringBuffer();
195                 for ( java.util.Iterator i = errors.iterator(); i.hasNext(); )
196                 {
197                     String error = (String) i.next();
198                     message.append( error );
199                     message.append( "\n" );
200                 }
201                 return message.toString();
202             }
203           
204 }