001// =================== DO NOT EDIT THIS FILE ====================
002// Generated by Modello 1.8.3,
003// any modifications will be overwritten.
004// ==============================================================
005
006package org.apache.maven.settings;
007
008/**
009 * 
010 *         common base class that contains code to track the source
011 * for
012 *         this instance (USER|GLOBAL)
013 *       .
014 * 
015 * @version $Revision$ $Date$
016 */
017@SuppressWarnings( "all" )
018public class TrackableBase
019    implements java.io.Serializable, java.lang.Cloneable
020{
021
022      //-----------/
023     //- Methods -/
024    //-----------/
025
026    /**
027     * Method clone.
028     * 
029     * @return TrackableBase
030     */
031    public TrackableBase clone()
032    {
033        try
034        {
035            TrackableBase copy = (TrackableBase) super.clone();
036
037            return copy;
038        }
039        catch ( java.lang.Exception ex )
040        {
041            throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
042                + " does not support clone()" ).initCause( ex );
043        }
044    } //-- TrackableBase clone()
045
046    
047            
048    public static final String USER_LEVEL = "user-level";
049    public static final String GLOBAL_LEVEL = "global-level";
050
051    private String sourceLevel = USER_LEVEL;
052    private boolean sourceLevelSet = false;
053
054    public void setSourceLevel( String sourceLevel )
055    {
056        if ( sourceLevelSet )
057        {
058            throw new IllegalStateException( "Cannot reset sourceLevel attribute; it is already set to: " + sourceLevel );
059        }
060        else if ( !( USER_LEVEL.equals( sourceLevel ) || GLOBAL_LEVEL.equals( sourceLevel ) ) )
061        {
062            throw new IllegalArgumentException( "sourceLevel must be one of: {" + USER_LEVEL + "," + GLOBAL_LEVEL + "}" );
063        }
064        else
065        {
066            this.sourceLevel = sourceLevel;
067            this.sourceLevelSet = true;
068        }
069    }
070
071    public String getSourceLevel()
072    {
073        return sourceLevel;
074    }
075            
076          
077}