1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 package org.apache.maven.settings;
25
26
27
28
29
30
31
32
33
34
35 @SuppressWarnings( "all" )
36 public class TrackableBase
37 implements java.io.Serializable, java.lang.Cloneable
38 {
39
40
41
42
43
44
45
46
47
48
49 public TrackableBase clone()
50 {
51 try
52 {
53 TrackableBase copy = (TrackableBase) super.clone();
54
55 return copy;
56 }
57 catch ( java.lang.Exception ex )
58 {
59 throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
60 + " does not support clone()" ).initCause( ex );
61 }
62 }
63
64
65
66 public static final String USER_LEVEL = "user-level";
67 public static final String GLOBAL_LEVEL = "global-level";
68
69 private String sourceLevel = USER_LEVEL;
70 private boolean sourceLevelSet = false;
71
72 public void setSourceLevel( String sourceLevel )
73 {
74 if ( sourceLevelSet )
75 {
76 throw new IllegalStateException( "Cannot reset sourceLevel attribute; it is already set to: " + sourceLevel );
77 }
78 else if ( !( USER_LEVEL.equals( sourceLevel ) || GLOBAL_LEVEL.equals( sourceLevel ) ) )
79 {
80 throw new IllegalArgumentException( "sourceLevel must be one of: {" + USER_LEVEL + "," + GLOBAL_LEVEL + "}" );
81 }
82 else
83 {
84 this.sourceLevel = sourceLevel;
85 this.sourceLevelSet = true;
86 }
87 }
88
89 public String getSourceLevel()
90 {
91 return sourceLevel;
92 }
93
94
95 }