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