1 package org.apache.maven.lifecycle.mapping;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import java.util.Collections;
23 import java.util.LinkedHashMap;
24 import java.util.Map;
25
26
27
28
29 public class Lifecycle
30 {
31
32
33
34 private String id;
35
36
37
38
39 private Map<String, LifecyclePhase> lifecyclePhases;
40
41
42
43
44 public String getId()
45 {
46 return this.id;
47 }
48
49
50
51
52 public Map<String, LifecyclePhase> getLifecyclePhases()
53 {
54 return this.lifecyclePhases;
55 }
56
57
58
59
60
61
62 public void setId( String id )
63 {
64 this.id = id;
65 }
66
67
68
69
70
71
72 public void setLifecyclePhases( Map<String, LifecyclePhase> lifecyclePhases )
73 {
74 this.lifecyclePhases = lifecyclePhases;
75 }
76
77 @Deprecated
78 public Map<String, String> getPhases()
79 {
80 Map<String, LifecyclePhase> lphases = getLifecyclePhases();
81 if ( lphases == null )
82 {
83 return null;
84 }
85
86 if ( lphases.isEmpty() )
87 {
88 return Collections.emptyMap();
89 }
90
91 Map<String, String> phases = new LinkedHashMap<>();
92 for ( Map.Entry<String, LifecyclePhase> e: lphases.entrySet() )
93 {
94 phases.put( e.getKey(), e.getValue().toString() );
95 }
96 return phases;
97 }
98
99 @Deprecated
100 public void setPhases( Map<String, String> phases )
101 {
102 Map<String, LifecyclePhase> lphases = new LinkedHashMap<>();
103 for ( Map.Entry<String, String> e: phases.entrySet() )
104 {
105 lphases.put( e.getKey(), new LifecyclePhase( e.getValue() ) );
106 }
107 setLifecyclePhases( lphases );
108 }
109 }