1 package org.apache.maven.model.profile;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import java.io.File;
23 import java.util.Collections;
24 import java.util.List;
25 import java.util.Map;
26 import java.util.Properties;
27
28
29
30
31
32
33 public class DefaultProfileActivationContext
34 implements ProfileActivationContext
35 {
36
37 private List<String> activeProfileIds = Collections.emptyList();
38
39 private List<String> inactiveProfileIds = Collections.emptyList();
40
41 private Map<String, String> systemProperties = Collections.emptyMap();
42
43 private Map<String, String> userProperties = Collections.emptyMap();
44
45 private File projectDirectory;
46
47 public List<String> getActiveProfileIds()
48 {
49 return activeProfileIds;
50 }
51
52
53
54
55
56
57
58 public DefaultProfileActivationContext setActiveProfileIds( List<String> activeProfileIds )
59 {
60 if ( activeProfileIds != null )
61 {
62 this.activeProfileIds = Collections.unmodifiableList( activeProfileIds );
63 }
64 else
65 {
66 this.activeProfileIds = Collections.emptyList();
67 }
68
69 return this;
70 }
71
72 public List<String> getInactiveProfileIds()
73 {
74 return inactiveProfileIds;
75 }
76
77
78
79
80
81
82
83 public DefaultProfileActivationContext setInactiveProfileIds( List<String> inactiveProfileIds )
84 {
85 if ( inactiveProfileIds != null )
86 {
87 this.inactiveProfileIds = Collections.unmodifiableList( inactiveProfileIds );
88 }
89 else
90 {
91 this.inactiveProfileIds = Collections.emptyList();
92 }
93
94 return this;
95 }
96
97 public Map<String, String> getSystemProperties()
98 {
99 return systemProperties;
100 }
101
102
103
104
105
106
107
108
109 @SuppressWarnings( "unchecked" )
110 public DefaultProfileActivationContext setSystemProperties( Properties systemProperties )
111 {
112 if ( systemProperties != null )
113 {
114 this.systemProperties = Collections.unmodifiableMap( (Map) systemProperties );
115 }
116 else
117 {
118 this.systemProperties = Collections.emptyMap();
119 }
120
121 return this;
122 }
123
124
125
126
127
128
129
130
131 public DefaultProfileActivationContext setSystemProperties( Map<String, String> systemProperties )
132 {
133 if ( systemProperties != null )
134 {
135 this.systemProperties = Collections.unmodifiableMap( systemProperties );
136 }
137 else
138 {
139 this.systemProperties = Collections.emptyMap();
140 }
141
142 return this;
143 }
144
145 public Map<String, String> getUserProperties()
146 {
147 return userProperties;
148 }
149
150
151
152
153
154
155
156
157
158 @SuppressWarnings( "unchecked" )
159 public DefaultProfileActivationContext setUserProperties( Properties userProperties )
160 {
161 if ( userProperties != null )
162 {
163 this.userProperties = Collections.unmodifiableMap( (Map) userProperties );
164 }
165 else
166 {
167 this.userProperties = Collections.emptyMap();
168 }
169
170 return this;
171 }
172
173
174
175
176
177
178
179
180
181 public DefaultProfileActivationContext setUserProperties( Map<String, String> userProperties )
182 {
183 if ( userProperties != null )
184 {
185 this.userProperties = Collections.unmodifiableMap( userProperties );
186 }
187 else
188 {
189 this.userProperties = Collections.emptyMap();
190 }
191
192 return this;
193 }
194
195 public File getProjectDirectory()
196 {
197 return projectDirectory;
198 }
199
200
201
202
203
204
205
206
207 public DefaultProfileActivationContext setProjectDirectory( File projectDirectory )
208 {
209 this.projectDirectory = projectDirectory;
210
211 return this;
212 }
213
214 }