All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.maven.model.RepositoryPolicy Maven / Gradle / Ivy

The newest version!
// =================== DO NOT EDIT THIS FILE ====================
// Generated by Modello 1.7,
// any modifications will be overwritten.
// ==============================================================

package org.apache.maven.model;

/**
 * Download policy.
 * 
 * @version $Revision$ $Date$
 */
@SuppressWarnings( "all" )
public class RepositoryPolicy
    implements java.io.Serializable, java.lang.Cloneable, org.apache.maven.model.InputLocationTracker
{

      //--------------------------/
     //- Class/Member Variables -/
    //--------------------------/

    /**
     * 
     *             
     *             Whether to use this repository for downloading
     * this type of artifact. Note: While the type
     *             of this field is String for
     * technical reasons, the semantic type is actually
     *             Boolean. Default value is
     * true.
     *             
     *           
     */
    private String enabled;

    /**
     * 
     *             
     *             The frequency for downloading updates - can be
     *             always,
     *             daily
     *             (default),
     *             interval:XXX
     *             (in minutes) or
     *             never
     *             (only if it doesn't exist locally).
     *             
     *           
     */
    private String updatePolicy;

    /**
     * 
     *             
     *             What to do when verification of an artifact
     * checksum fails. Valid values are
     *             ignore
     *             ,
     *             fail
     *             or
     *             warn
     *             (the default).
     *             
     *           
     */
    private String checksumPolicy;

    /**
     * Field locations.
     */
    private java.util.Map locations;


      //-----------/
     //- Methods -/
    //-----------/

    /**
     * Method clone.
     * 
     * @return RepositoryPolicy
     */
    public RepositoryPolicy clone()
    {
        try
        {
            RepositoryPolicy copy = (RepositoryPolicy) super.clone();

            if ( copy.locations != null )
            {
                copy.locations = new java.util.LinkedHashMap( copy.locations );
            }

            return copy;
        }
        catch ( java.lang.Exception ex )
        {
            throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
                + " does not support clone()" ).initCause( ex );
        }
    } //-- RepositoryPolicy clone()

    /**
     * Get what to do when verification of an artifact checksum
     * fails. Valid values are
     *             ignore
     *             ,
     *             fail
     *             or
     *             warn
     *             (the default).
     * 
     * @return String
     */
    public String getChecksumPolicy()
    {
        return this.checksumPolicy;
    } //-- String getChecksumPolicy()

    /**
     * Get whether to use this repository for downloading this type
     * of artifact. Note: While the type
     *             of this field is String for
     * technical reasons, the semantic type is actually
     *             Boolean. Default value is
     * true.
     * 
     * @return String
     */
    public String getEnabled()
    {
        return this.enabled;
    } //-- String getEnabled()

    /**
     * 
     * 
     * @param key
     * @return InputLocation
     */
    public InputLocation getLocation( Object key )
    {
        return ( locations != null ) ? locations.get( key ) : null;
    } //-- InputLocation getLocation( Object )

    /**
     * Get the frequency for downloading updates - can be
     *             always,
     *             daily
     *             (default),
     *             interval:XXX
     *             (in minutes) or
     *             never
     *             (only if it doesn't exist locally).
     * 
     * @return String
     */
    public String getUpdatePolicy()
    {
        return this.updatePolicy;
    } //-- String getUpdatePolicy()

    /**
     * Set what to do when verification of an artifact checksum
     * fails. Valid values are
     *             ignore
     *             ,
     *             fail
     *             or
     *             warn
     *             (the default).
     * 
     * @param checksumPolicy
     */
    public void setChecksumPolicy( String checksumPolicy )
    {
        this.checksumPolicy = checksumPolicy;
    } //-- void setChecksumPolicy( String )

    /**
     * Set whether to use this repository for downloading this type
     * of artifact. Note: While the type
     *             of this field is String for
     * technical reasons, the semantic type is actually
     *             Boolean. Default value is
     * true.
     * 
     * @param enabled
     */
    public void setEnabled( String enabled )
    {
        this.enabled = enabled;
    } //-- void setEnabled( String )

    /**
     * 
     * 
     * @param key
     * @param location
     */
    public void setLocation( Object key, InputLocation location )
    {
        if ( location != null )
        {
            if ( this.locations == null )
            {
                this.locations = new java.util.LinkedHashMap();
            }
            this.locations.put( key, location );
        }
    } //-- void setLocation( Object, InputLocation )

    /**
     * Set the frequency for downloading updates - can be
     *             always,
     *             daily
     *             (default),
     *             interval:XXX
     *             (in minutes) or
     *             never
     *             (only if it doesn't exist locally).
     * 
     * @param updatePolicy
     */
    public void setUpdatePolicy( String updatePolicy )
    {
        this.updatePolicy = updatePolicy;
    } //-- void setUpdatePolicy( String )

    
            

    public boolean isEnabled()
    {
        return ( enabled != null ) ? Boolean.parseBoolean( enabled ) : true;
    }

    public void setEnabled( boolean enabled )
    {
        this.enabled = String.valueOf( enabled );
    }

            
          
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy