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

org.fedoraproject.xmvn.metadata.ArtifactMetadata Maven / Gradle / Ivy

Go to download

This module contains public interface for functionality implemented by XMvn Core.

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

package org.fedoraproject.xmvn.metadata;

/**
 * Information about a single artifact.
 * 
 * @version $Revision$ $Date$
 */
@SuppressWarnings( "all" )
public class ArtifactMetadata
    implements java.io.Serializable, java.lang.Cloneable
{

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

    /**
     * Group identifier of the artifact.
     */
    private String groupId;

    /**
     * Identifier of the artifact.
     */
    private String artifactId;

    /**
     * Extension of artifact file.
     */
    private String extension = "jar";

    /**
     * Classifier of the artifact.
     */
    private String classifier = "";

    /**
     * Artifact version. This is always upstream version, never
     * compat version nor SYSTEM.
     */
    private String version;

    /**
     * Absolute path to artifact file stored in the local file
     * system.
     */
    private String path;

    /**
     * A namespace within which this artifact is stored. This
     * usually is an identifier of software collection.
     */
    private String namespace = "";

    /**
     * Deprecated, unused.
     */
    private String uuid = "";

    /**
     * Field properties.
     */
    private java.util.Properties properties;

    /**
     * Field compatVersions.
     */
    private java.util.List compatVersions;

    /**
     * Field aliases.
     */
    private java.util.List aliases;

    /**
     * Field dependencies.
     */
    private java.util.List dependencies;


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

    /**
     * Method addCompatVersion.
     * 
     * @param string a string object.
     */
    public void addCompatVersion( String string )
    {
        getCompatVersions().add( string );
    } //-- void addCompatVersion( String )

    /**
     * Method addDependency.
     * 
     * @param dependency a dependency object.
     */
    public void addDependency( Dependency dependency )
    {
        getDependencies().add( dependency );
    } //-- void addDependency( Dependency )

    /**
     * Method addProperty.
     * 
     * @param key a key object.
     * @param value a value object.
     */
    public void addProperty( String key, String value )
    {
        getProperties().put( key, value );
    } //-- void addProperty( String, String )

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

            if ( this.properties != null )
            {
                copy.properties = (java.util.Properties) this.properties.clone();
            }

            if ( this.compatVersions != null )
            {
                copy.compatVersions = new java.util.ArrayList();
                copy.compatVersions.addAll( this.compatVersions );
            }

            if ( this.aliases != null )
            {
                copy.aliases = new java.util.ArrayList();
                for ( ArtifactAlias item : this.aliases )
                {
                    copy.aliases.add( ( (ArtifactAlias) item).clone() );
                }
            }

            if ( this.dependencies != null )
            {
                copy.dependencies = new java.util.ArrayList();
                for ( Dependency item : this.dependencies )
                {
                    copy.dependencies.add( ( (Dependency) item).clone() );
                }
            }

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

    /**
     * Method getAliases.
     * 
     * @return List
     */
    public java.util.List getAliases()
    {
        if ( this.aliases == null )
        {
            this.aliases = new java.util.ArrayList();
        }

        return this.aliases;
    } //-- java.util.List getAliases()

    /**
     * Get identifier of the artifact.
     * 
     * @return String
     */
    public String getArtifactId()
    {
        return this.artifactId;
    } //-- String getArtifactId()

    /**
     * Get classifier of the artifact.
     * 
     * @return String
     */
    public String getClassifier()
    {
        return this.classifier;
    } //-- String getClassifier()

    /**
     * Method getCompatVersions.
     * 
     * @return List
     */
    public java.util.List getCompatVersions()
    {
        if ( this.compatVersions == null )
        {
            this.compatVersions = new java.util.ArrayList();
        }

        return this.compatVersions;
    } //-- java.util.List getCompatVersions()

    /**
     * Method getDependencies.
     * 
     * @return List
     */
    public java.util.List getDependencies()
    {
        if ( this.dependencies == null )
        {
            this.dependencies = new java.util.ArrayList();
        }

        return this.dependencies;
    } //-- java.util.List getDependencies()

    /**
     * Get extension of artifact file.
     * 
     * @return String
     */
    public String getExtension()
    {
        return this.extension;
    } //-- String getExtension()

    /**
     * Get group identifier of the artifact.
     * 
     * @return String
     */
    public String getGroupId()
    {
        return this.groupId;
    } //-- String getGroupId()

    /**
     * Get a namespace within which this artifact is stored. This
     * usually is an identifier of software collection.
     * 
     * @return String
     */
    public String getNamespace()
    {
        return this.namespace;
    } //-- String getNamespace()

    /**
     * Get absolute path to artifact file stored in the local file
     * system.
     * 
     * @return String
     */
    public String getPath()
    {
        return this.path;
    } //-- String getPath()

    /**
     * Method getProperties.
     * 
     * @return Properties
     */
    public java.util.Properties getProperties()
    {
        if ( this.properties == null )
        {
            this.properties = new java.util.Properties();
        }

        return this.properties;
    } //-- java.util.Properties getProperties()

    /**
     * Get deprecated, unused.
     * 
     * @return String
     */
    public String getUuid()
    {
        return this.uuid;
    } //-- String getUuid()

    /**
     * Get artifact version. This is always upstream version, never
     * compat version nor SYSTEM.
     * 
     * @return String
     */
    public String getVersion()
    {
        return this.version;
    } //-- String getVersion()

    /**
     * Method removeCompatVersion.
     * 
     * @param string a string object.
     */
    public void removeCompatVersion( String string )
    {
        getCompatVersions().remove( string );
    } //-- void removeCompatVersion( String )

    /**
     * Method removeDependency.
     * 
     * @param dependency a dependency object.
     */
    public void removeDependency( Dependency dependency )
    {
        getDependencies().remove( dependency );
    } //-- void removeDependency( Dependency )

    /**
     * Set alternative identifiers of the artifact.
     * 
     * @param aliases a aliases object.
     */
    public void setAliases( java.util.List aliases )
    {
        this.aliases = aliases;
    } //-- void setAliases( java.util.List )

    /**
     * Set identifier of the artifact.
     * 
     * @param artifactId a artifactId object.
     */
    public void setArtifactId( String artifactId )
    {
        this.artifactId = artifactId;
    } //-- void setArtifactId( String )

    /**
     * Set classifier of the artifact.
     * 
     * @param classifier a classifier object.
     */
    public void setClassifier( String classifier )
    {
        this.classifier = classifier;
    } //-- void setClassifier( String )

    /**
     * Set compatibility versions of this artifact. If the list is
     * empty then this artifact is not considered as compatibility
     * artifact.
     * 
     * @param compatVersions a compatVersions object.
     */
    public void setCompatVersions( java.util.List compatVersions )
    {
        this.compatVersions = compatVersions;
    } //-- void setCompatVersions( java.util.List )

    /**
     * Set list of artifact dependencies.
     * 
     * @param dependencies a dependencies object.
     */
    public void setDependencies( java.util.List dependencies )
    {
        this.dependencies = dependencies;
    } //-- void setDependencies( java.util.List )

    /**
     * Set extension of artifact file.
     * 
     * @param extension a extension object.
     */
    public void setExtension( String extension )
    {
        this.extension = extension;
    } //-- void setExtension( String )

    /**
     * Set group identifier of the artifact.
     * 
     * @param groupId a groupId object.
     */
    public void setGroupId( String groupId )
    {
        this.groupId = groupId;
    } //-- void setGroupId( String )

    /**
     * Set a namespace within which this artifact is stored. This
     * usually is an identifier of software collection.
     * 
     * @param namespace a namespace object.
     */
    public void setNamespace( String namespace )
    {
        this.namespace = namespace;
    } //-- void setNamespace( String )

    /**
     * Set absolute path to artifact file stored in the local file
     * system.
     * 
     * @param path a path object.
     */
    public void setPath( String path )
    {
        this.path = path;
    } //-- void setPath( String )

    /**
     * Set extra properties of this artifact.
     * 
     * @param properties a properties object.
     */
    public void setProperties( java.util.Properties properties )
    {
        this.properties = properties;
    } //-- void setProperties( java.util.Properties )

    /**
     * Set deprecated, unused.
     * 
     * @param uuid a uuid object.
     */
    public void setUuid( String uuid )
    {
        this.uuid = uuid;
    } //-- void setUuid( String )

    /**
     * Set artifact version. This is always upstream version, never
     * compat version nor SYSTEM.
     * 
     * @param version a version object.
     */
    public void setVersion( String version )
    {
        this.version = version;
    } //-- void setVersion( String )

    
                /**
     * Add an alias.
     * @param alias alias to be added
     */
    public void addAlias( ArtifactAlias alias )
    {
        getAliases().add( alias );
    }

    /**
     * Remove an alias.
     * @param alias alias to be removed
     */
    public void removeAlias( ArtifactAlias alias )
    {
        getAliases().remove( alias );
    }

    public org.fedoraproject.xmvn.artifact.Artifact toArtifact()
    {
        return new org.fedoraproject.xmvn.artifact.DefaultArtifact( getGroupId(), getArtifactId(), getExtension(), getClassifier(), getVersion() );
    }

    public String toString()
    {
        return toArtifact().toString();
    }
     
          
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy