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