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