1
2
3
4
5
6
7
8 package org.apache.maven.continuum.model.project.v1_0_9;
9
10
11
12
13
14 import java.util.Collection;
15 import org.apache.maven.continuum.model.scm.v1_0_9.ChangeFile;
16 import org.apache.maven.continuum.model.scm.v1_0_9.ChangeSet;
17 import org.apache.maven.continuum.model.scm.v1_0_9.ScmResult;
18 import org.apache.maven.continuum.model.scm.v1_0_9.SuiteResult;
19 import org.apache.maven.continuum.model.scm.v1_0_9.TestCaseFailure;
20 import org.apache.maven.continuum.model.scm.v1_0_9.TestResult;
21 import org.apache.maven.continuum.model.system.v1_0_9.NotificationAddress;
22 import org.apache.maven.continuum.model.system.v1_0_9.SystemConfiguration;
23
24
25
26
27
28
29 @SuppressWarnings( "all" )
30 public class Project
31 implements java.io.Serializable
32 {
33
34
35
36
37
38
39
40
41 private int id = 0;
42
43
44
45
46 private String groupId;
47
48
49
50
51 private String artifactId;
52
53
54
55
56 private String executorId;
57
58
59
60
61 private String name;
62
63
64
65
66 private String description;
67
68
69
70
71 private String url;
72
73
74
75
76 private String scmUrl;
77
78
79
80
81 private String scmTag;
82
83
84
85
86 private String scmUsername;
87
88
89
90
91 private String scmPassword;
92
93
94
95
96 private String version;
97
98
99
100
101 private int state = 1;
102
103
104
105
106 private int oldState = 0;
107
108
109
110
111 private int latestBuildId = 0;
112
113
114
115
116 private int buildNumber = 0;
117
118
119
120
121 private String workingDirectory;
122
123
124
125
126 private java.util.List<BuildResult> buildResults;
127
128
129
130
131 private ScmResult checkoutResult;
132
133
134
135
136 private java.util.List<ProjectDeveloper> developers;
137
138
139
140
141 private ProjectDependency parent;
142
143
144
145
146 private java.util.List<ProjectDependency> dependencies;
147
148
149
150
151 private ProjectGroup projectGroup;
152
153
154
155
156 private java.util.List<ProjectNotifier> notifiers;
157
158
159
160
161 private java.util.List<BuildDefinition> buildDefinitions;
162
163
164
165
166
167
168
169
170
171
172
173 public void addBuildDefinition( BuildDefinition buildDefinition )
174 {
175 getBuildDefinitions().add( buildDefinition );
176 }
177
178
179
180
181
182
183 public void addBuildResult( BuildResult buildResult )
184 {
185 getBuildResults().add( buildResult );
186 buildResult.createProjectAssociation( this );
187 }
188
189
190
191
192
193
194 public void addDependency( ProjectDependency projectDependency )
195 {
196 getDependencies().add( projectDependency );
197 }
198
199
200
201
202
203
204 public void addDeveloper( ProjectDeveloper projectDeveloper )
205 {
206 getDevelopers().add( projectDeveloper );
207 }
208
209
210
211
212
213
214 public void addNotifier( ProjectNotifier projectNotifier )
215 {
216 getNotifiers().add( projectNotifier );
217 }
218
219
220
221
222
223
224 public void breakBuildResultAssociation( BuildResult buildResult )
225 {
226 if ( ! getBuildResults().contains( buildResult ) )
227 {
228 throw new IllegalStateException( "buildResult isn't associated." );
229 }
230
231 getBuildResults().remove( buildResult );
232 }
233
234
235
236
237
238
239 public void breakProjectGroupAssociation( ProjectGroup projectGroup )
240 {
241 if ( this.projectGroup != projectGroup )
242 {
243 throw new IllegalStateException( "projectGroup isn't associated." );
244 }
245
246 this.projectGroup = null;
247 }
248
249
250
251
252
253
254 public void createBuildResultAssociation( BuildResult buildResult )
255 {
256 Collection buildResults = getBuildResults();
257
258 if ( buildResults.contains( buildResult ) )
259 {
260 throw new IllegalStateException( "buildResult is already assigned." );
261 }
262
263 buildResults.add( buildResult );
264 }
265
266
267
268
269
270
271 public void createProjectGroupAssociation( ProjectGroup projectGroup )
272 {
273 if ( this.projectGroup != null )
274 {
275 breakProjectGroupAssociation( this.projectGroup );
276 }
277
278 this.projectGroup = projectGroup;
279 }
280
281
282
283
284
285
286
287 public boolean equals( Object other )
288 {
289 if ( this == other )
290 {
291 return true;
292 }
293
294 if ( !( other instanceof Project ) )
295 {
296 return false;
297 }
298
299 Project that = (Project) other;
300 boolean result = true;
301
302 result = result && id == that.id;
303
304 return result;
305 }
306
307
308
309
310
311
312 public String getArtifactId()
313 {
314 return this.artifactId;
315 }
316
317
318
319
320
321
322 public java.util.List<BuildDefinition> getBuildDefinitions()
323 {
324 if ( this.buildDefinitions == null )
325 {
326 this.buildDefinitions = new java.util.ArrayList<BuildDefinition>();
327 }
328
329 return this.buildDefinitions;
330 }
331
332
333
334
335
336
337 public int getBuildNumber()
338 {
339 return this.buildNumber;
340 }
341
342
343
344
345
346
347 public java.util.List<BuildResult> getBuildResults()
348 {
349 if ( this.buildResults == null )
350 {
351 this.buildResults = new java.util.ArrayList<BuildResult>();
352 }
353
354 return this.buildResults;
355 }
356
357
358
359
360
361
362 public ScmResult getCheckoutResult()
363 {
364 return this.checkoutResult;
365 }
366
367
368
369
370
371
372 public java.util.List<ProjectDependency> getDependencies()
373 {
374 if ( this.dependencies == null )
375 {
376 this.dependencies = new java.util.ArrayList<ProjectDependency>();
377 }
378
379 return this.dependencies;
380 }
381
382
383
384
385
386
387 public String getDescription()
388 {
389 return this.description;
390 }
391
392
393
394
395
396
397 public java.util.List<ProjectDeveloper> getDevelopers()
398 {
399 if ( this.developers == null )
400 {
401 this.developers = new java.util.ArrayList<ProjectDeveloper>();
402 }
403
404 return this.developers;
405 }
406
407
408
409
410
411
412 public String getExecutorId()
413 {
414 return this.executorId;
415 }
416
417
418
419
420
421
422 public String getGroupId()
423 {
424 return this.groupId;
425 }
426
427
428
429
430
431
432 public int getId()
433 {
434 return this.id;
435 }
436
437
438
439
440
441
442 public int getLatestBuildId()
443 {
444 return this.latestBuildId;
445 }
446
447
448
449
450
451
452 public String getName()
453 {
454 return this.name;
455 }
456
457
458
459
460
461
462 public java.util.List<ProjectNotifier> getNotifiers()
463 {
464 if ( this.notifiers == null )
465 {
466 this.notifiers = new java.util.ArrayList<ProjectNotifier>();
467 }
468
469 return this.notifiers;
470 }
471
472
473
474
475
476
477 public int getOldState()
478 {
479 return this.oldState;
480 }
481
482
483
484
485
486
487 public ProjectDependency getParent()
488 {
489 return this.parent;
490 }
491
492
493
494
495
496
497 public ProjectGroup getProjectGroup()
498 {
499 return this.projectGroup;
500 }
501
502
503
504
505
506
507 public String getScmPassword()
508 {
509 return this.scmPassword;
510 }
511
512
513
514
515
516
517 public String getScmTag()
518 {
519 return this.scmTag;
520 }
521
522
523
524
525
526
527 public String getScmUrl()
528 {
529 return this.scmUrl;
530 }
531
532
533
534
535
536
537 public String getScmUsername()
538 {
539 return this.scmUsername;
540 }
541
542
543
544
545
546
547 public int getState()
548 {
549 return this.state;
550 }
551
552
553
554
555
556
557 public String getUrl()
558 {
559 return this.url;
560 }
561
562
563
564
565
566
567 public String getVersion()
568 {
569 return this.version;
570 }
571
572
573
574
575
576
577 public String getWorkingDirectory()
578 {
579 return this.workingDirectory;
580 }
581
582
583
584
585
586
587 public int hashCode()
588 {
589 int result = 17;
590
591 result = 37 * result + (int) id;
592
593 return result;
594 }
595
596
597
598
599
600
601 public void removeBuildDefinition( BuildDefinition buildDefinition )
602 {
603 getBuildDefinitions().remove( buildDefinition );
604 }
605
606
607
608
609
610
611 public void removeBuildResult( BuildResult buildResult )
612 {
613 buildResult.breakProjectAssociation( this );
614 getBuildResults().remove( buildResult );
615 }
616
617
618
619
620
621
622 public void removeDependency( ProjectDependency projectDependency )
623 {
624 getDependencies().remove( projectDependency );
625 }
626
627
628
629
630
631
632 public void removeDeveloper( ProjectDeveloper projectDeveloper )
633 {
634 getDevelopers().remove( projectDeveloper );
635 }
636
637
638
639
640
641
642 public void removeNotifier( ProjectNotifier projectNotifier )
643 {
644 getNotifiers().remove( projectNotifier );
645 }
646
647
648
649
650
651
652 public void setArtifactId( String artifactId )
653 {
654 this.artifactId = artifactId;
655 }
656
657
658
659
660
661
662 public void setBuildDefinitions( java.util.List<BuildDefinition> buildDefinitions )
663 {
664 this.buildDefinitions = buildDefinitions;
665 }
666
667
668
669
670
671
672 public void setBuildNumber( int buildNumber )
673 {
674 this.buildNumber = buildNumber;
675 }
676
677
678
679
680
681
682 public void setBuildResults( java.util.List<BuildResult> buildResults )
683 {
684 this.buildResults = buildResults;
685 }
686
687
688
689
690
691
692 public void setCheckoutResult( ScmResult checkoutResult )
693 {
694 this.checkoutResult = checkoutResult;
695 }
696
697
698
699
700
701
702 public void setDependencies( java.util.List<ProjectDependency> dependencies )
703 {
704 this.dependencies = dependencies;
705 }
706
707
708
709
710
711
712 public void setDescription( String description )
713 {
714 this.description = description;
715 }
716
717
718
719
720
721
722 public void setDevelopers( java.util.List<ProjectDeveloper> developers )
723 {
724 this.developers = developers;
725 }
726
727
728
729
730
731
732 public void setExecutorId( String executorId )
733 {
734 this.executorId = executorId;
735 }
736
737
738
739
740
741
742 public void setGroupId( String groupId )
743 {
744 this.groupId = groupId;
745 }
746
747
748
749
750
751
752 public void setId( int id )
753 {
754 this.id = id;
755 }
756
757
758
759
760
761
762 public void setLatestBuildId( int latestBuildId )
763 {
764 this.latestBuildId = latestBuildId;
765 }
766
767
768
769
770
771
772 public void setName( String name )
773 {
774 this.name = name;
775 }
776
777
778
779
780
781
782 public void setNotifiers( java.util.List<ProjectNotifier> notifiers )
783 {
784 this.notifiers = notifiers;
785 }
786
787
788
789
790
791
792 public void setOldState( int oldState )
793 {
794 this.oldState = oldState;
795 }
796
797
798
799
800
801
802 public void setParent( ProjectDependency parent )
803 {
804 this.parent = parent;
805 }
806
807
808
809
810
811
812 public void setProjectGroup( ProjectGroup projectGroup )
813 {
814 if ( this.projectGroup != null )
815 {
816 this.projectGroup.breakProjectAssociation( this );
817 }
818
819 this.projectGroup = projectGroup;
820
821 if ( projectGroup != null )
822 {
823 this.projectGroup.createProjectAssociation( this );
824 }
825 }
826
827
828
829
830
831
832 public void setScmPassword( String scmPassword )
833 {
834 this.scmPassword = scmPassword;
835 }
836
837
838
839
840
841
842 public void setScmTag( String scmTag )
843 {
844 this.scmTag = scmTag;
845 }
846
847
848
849
850
851
852 public void setScmUrl( String scmUrl )
853 {
854 this.scmUrl = scmUrl;
855 }
856
857
858
859
860
861
862 public void setScmUsername( String scmUsername )
863 {
864 this.scmUsername = scmUsername;
865 }
866
867
868
869
870
871
872 public void setState( int state )
873 {
874 this.state = state;
875 }
876
877
878
879
880
881
882 public void setUrl( String url )
883 {
884 this.url = url;
885 }
886
887
888
889
890
891
892 public void setVersion( String version )
893 {
894 this.version = version;
895 }
896
897
898
899
900
901
902 public void setWorkingDirectory( String workingDirectory )
903 {
904 this.workingDirectory = workingDirectory;
905 }
906
907
908
909
910
911
912 public java.lang.String toString()
913 {
914 StringBuilder buf = new StringBuilder( 128 );
915
916 buf.append( "id = '" );
917 buf.append( getId() );
918 buf.append( "'" );
919
920 return buf.toString();
921 }
922
923 }