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 @Experimental
23 @Generated @ThreadSafe @Immutable
24 public class TrackableBase
25 implements Serializable
26 {
27
28
29
30
31
32 TrackableBase(
33 )
34 {
35 }
36
37
38
39
40
41
42 @Nonnull
43 public Builder with()
44 {
45 return newBuilder( this );
46 }
47
48
49
50
51
52
53
54
55 @Nonnull
56 public static TrackableBase newInstance()
57 {
58 return newInstance( true );
59 }
60
61
62
63
64
65
66
67
68 @Nonnull
69 public static TrackableBase newInstance( boolean withDefaults )
70 {
71 return newBuilder( withDefaults ).build();
72 }
73
74
75
76
77
78
79
80
81 @Nonnull
82 public static Builder newBuilder()
83 {
84 return newBuilder( true );
85 }
86
87
88
89
90
91
92
93 @Nonnull
94 public static Builder newBuilder( boolean withDefaults )
95 {
96 return new Builder( withDefaults );
97 }
98
99
100
101
102
103
104
105
106 @Nonnull
107 public static Builder newBuilder( TrackableBase from )
108 {
109 return newBuilder( from, false );
110 }
111
112
113
114
115
116
117
118
119 @Nonnull
120 public static Builder newBuilder( TrackableBase from, boolean forceCopy )
121 {
122 return new Builder( from, forceCopy );
123 }
124
125
126
127
128
129
130 @NotThreadSafe
131 public static class Builder
132 {
133 TrackableBase base;
134
135 Builder( boolean withDefaults )
136 {
137 if ( withDefaults )
138 {
139 }
140 }
141
142 Builder( TrackableBase base, boolean forceCopy )
143 {
144 if ( forceCopy )
145 {
146 }
147 else
148 {
149 this.base = base;
150 }
151 }
152
153
154 @Nonnull
155 public TrackableBase build()
156 {
157 if ( base != null
158 )
159 {
160 return base;
161 }
162 return new TrackableBase(
163 );
164 }
165 }
166
167
168
169 public static final String USER_LEVEL = "user-level";
170 public static final String GLOBAL_LEVEL = "global-level";
171
172 private String sourceLevel = USER_LEVEL;
173 private boolean sourceLevelSet = false;
174
175 public void setSourceLevel( String sourceLevel )
176 {
177 if ( sourceLevelSet )
178 {
179 throw new IllegalStateException( "Cannot reset sourceLevel attribute; it is already set to: " + sourceLevel );
180 }
181 else if ( !( USER_LEVEL.equals( sourceLevel ) || GLOBAL_LEVEL.equals( sourceLevel ) ) )
182 {
183 throw new IllegalArgumentException( "sourceLevel must be one of: {" + USER_LEVEL + "," + GLOBAL_LEVEL + "}" );
184 }
185 else
186 {
187 this.sourceLevel = sourceLevel;
188 this.sourceLevelSet = true;
189 }
190 }
191
192 public String getSourceLevel()
193 {
194 return sourceLevel;
195 }
196
197
198 }