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