1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19 package org.apache.maven.plugin.lifecycle;
20
21 /**
22 *
23 * A custom lifecycle mapping definition.
24 *
25 *
26 * @version $Revision$ $Date$
27 */
28 @SuppressWarnings("all")
29 public class Lifecycle implements java.io.Serializable {
30
31 // --------------------------/
32 // - Class/Member Variables -/
33 // --------------------------/
34
35 /**
36 * The ID of this lifecycle, for identification in the mojo
37 * descriptor.
38 */
39 private String id;
40
41 /**
42 * Field phases.
43 */
44 private java.util.List<Phase> phases;
45
46 // -----------/
47 // - Methods -/
48 // -----------/
49
50 /**
51 * Method addPhase.
52 *
53 * @param phase a phase object.
54 */
55 public void addPhase(Phase phase) {
56 getPhases().add(phase);
57 } // -- void addPhase( Phase )
58
59 /**
60 * Get the ID of this lifecycle, for identification in the mojo
61 * descriptor.
62 *
63 * @return String
64 */
65 public String getId() {
66 return this.id;
67 } // -- String getId()
68
69 /**
70 * Method getPhases.
71 *
72 * @return List
73 */
74 public java.util.List<Phase> getPhases() {
75 if (this.phases == null) {
76 this.phases = new java.util.ArrayList<Phase>();
77 }
78
79 return this.phases;
80 } // -- java.util.List<Phase> getPhases()
81
82 /**
83 * Method removePhase.
84 *
85 * @param phase a phase object.
86 */
87 public void removePhase(Phase phase) {
88 getPhases().remove(phase);
89 } // -- void removePhase( Phase )
90
91 /**
92 * Set the ID of this lifecycle, for identification in the mojo
93 * descriptor.
94 *
95 * @param id a id object.
96 */
97 public void setId(String id) {
98 this.id = id;
99 } // -- void setId( String )
100
101 /**
102 * Set the phase mappings for this lifecycle.
103 *
104 * @param phases a phases object.
105 */
106 public void setPhases(java.util.List<Phase> phases) {
107 this.phases = phases;
108 } // -- void setPhases( java.util.List )
109 }