Coverage Report - org.apache.maven.settings.TrackableBase
 
Classes in this File Line Coverage Branch Coverage Complexity
TrackableBase
73 %
8/11
50 %
3/6
3
 
 1  
 /*
 2  
  =================== DO NOT EDIT THIS FILE ====================
 3  
  Generated by Modello 1.0.1 on 2009-09-09 03:05:33,
 4  
  any modifications will be overwritten.
 5  
  ==============================================================
 6  
  */
 7  
 
 8  
 package org.apache.maven.settings;
 9  
 
 10  
 /**
 11  
  * 
 12  
  *         common base class that contains code to track the source
 13  
  * for
 14  
  *         this instance (USER|GLOBAL)
 15  
  *       .
 16  
  * 
 17  
  * @version $Revision$ $Date$
 18  
  */
 19  10
 public class TrackableBase
 20  
     implements java.io.Serializable
 21  
 {
 22  
 
 23  
             
 24  
     public static final String USER_LEVEL = "user-level";
 25  
     public static final String GLOBAL_LEVEL = "global-level";
 26  
 
 27  10
     private String sourceLevel = USER_LEVEL;
 28  10
     private boolean sourceLevelSet = false;
 29  
 
 30  
     public void setSourceLevel( String sourceLevel )
 31  
     {
 32  4
         if ( sourceLevelSet )
 33  
         {
 34  0
             throw new IllegalStateException( "Cannot reset sourceLevel attribute; it is already set to: " + sourceLevel );
 35  
         }
 36  4
         else if ( !( USER_LEVEL.equals( sourceLevel ) || GLOBAL_LEVEL.equals( sourceLevel ) ) )
 37  
         {
 38  0
             throw new IllegalArgumentException( "sourceLevel must be one of: {" + USER_LEVEL + "," + GLOBAL_LEVEL + "}" );
 39  
         }
 40  
         else
 41  
         {
 42  4
             this.sourceLevel = sourceLevel;
 43  4
             this.sourceLevelSet = true;
 44  
         }
 45  4
     }
 46  
 
 47  
     public String getSourceLevel()
 48  
     {
 49  0
         return sourceLevel;
 50  
     }
 51  
             
 52  
           
 53  
 }