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