1
2
3
4 package org.apache.maven.api.settings;
5
6 import java.io.Serializable;
7 import java.util.Collections;
8 import java.util.HashMap;
9 import java.util.Map;
10 import org.apache.maven.api.annotations.Experimental;
11 import org.apache.maven.api.annotations.Generated;
12 import org.apache.maven.api.annotations.Immutable;
13 import org.apache.maven.api.annotations.Nonnull;
14 import org.apache.maven.api.annotations.NotThreadSafe;
15 import org.apache.maven.api.annotations.ThreadSafe;
16
17
18
19
20
21
22 @Experimental
23 @Generated @ThreadSafe @Immutable
24 public class ActivationFile
25 implements Serializable
26 {
27
28
29
30
31 final String missing;
32
33
34
35 final String exists;
36
37
38
39
40
41 ActivationFile(
42 String missing,
43 String exists
44 )
45 {
46 this.missing = missing;
47 this.exists = exists;
48 }
49
50
51
52
53
54
55
56 public String getMissing()
57 {
58 return this.missing;
59 }
60
61
62
63
64
65
66 public String getExists()
67 {
68 return this.exists;
69 }
70
71
72
73
74
75
76 @Nonnull
77 public Builder with()
78 {
79 return newBuilder( this );
80 }
81
82
83
84
85
86
87 @Nonnull
88 public ActivationFile withMissing( String missing )
89 {
90 return with().missing( missing ).build();
91 }
92
93
94
95
96
97
98 @Nonnull
99 public ActivationFile withExists( String exists )
100 {
101 return with().exists( exists ).build();
102 }
103
104
105
106
107
108
109
110
111 @Nonnull
112 public static ActivationFile newInstance()
113 {
114 return newInstance( true );
115 }
116
117
118
119
120
121
122
123
124 @Nonnull
125 public static ActivationFile newInstance( boolean withDefaults )
126 {
127 return newBuilder( withDefaults ).build();
128 }
129
130
131
132
133
134
135
136
137 @Nonnull
138 public static Builder newBuilder()
139 {
140 return newBuilder( true );
141 }
142
143
144
145
146
147
148
149 @Nonnull
150 public static Builder newBuilder( boolean withDefaults )
151 {
152 return new Builder( withDefaults );
153 }
154
155
156
157
158
159
160
161
162 @Nonnull
163 public static Builder newBuilder( ActivationFile from )
164 {
165 return newBuilder( from, false );
166 }
167
168
169
170
171
172
173
174
175 @Nonnull
176 public static Builder newBuilder( ActivationFile from, boolean forceCopy )
177 {
178 return new Builder( from, forceCopy );
179 }
180
181
182
183
184
185
186 @NotThreadSafe
187 public static class Builder
188 {
189 ActivationFile base;
190 String missing;
191 String exists;
192
193 Builder( boolean withDefaults )
194 {
195 if ( withDefaults )
196 {
197 }
198 }
199
200 Builder( ActivationFile base, boolean forceCopy )
201 {
202 if ( forceCopy )
203 {
204 this.missing = base.missing;
205 this.exists = base.exists;
206 }
207 else
208 {
209 this.base = base;
210 }
211 }
212
213 @Nonnull
214 public Builder missing( String missing )
215 {
216 this.missing = missing;
217 return this;
218 }
219
220 @Nonnull
221 public Builder exists( String exists )
222 {
223 this.exists = exists;
224 return this;
225 }
226
227
228 @Nonnull
229 public ActivationFile build()
230 {
231 if ( base != null
232 && ( missing == null || missing == base.missing )
233 && ( exists == null || exists == base.exists )
234 )
235 {
236 return base;
237 }
238 return new ActivationFile(
239 missing != null ? missing : ( base != null ? base.missing : null ),
240 exists != null ? exists : ( base != null ? base.exists : null )
241 );
242 }
243 }
244
245 }