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

shaded.org.apache.maven.artifact.repository.metadata.Versioning Maven / Gradle / Ivy

There is a newer version: 4.1.2
Show newest version
// =================== DO NOT EDIT THIS FILE ====================
// Generated by Modello 1.9.1,
// any modifications will be overwritten.
// ==============================================================

package shaded.shaded.org.apache.maven.artifact.repository.metadata;

/**
 * Versioning information for an artifact (un-versioned or
 * snapshot).
 * 
 * @version $Revision$ $Date$
 */
@SuppressWarnings( "all" )
public class Versioning
    implements java.io.Serializable, java.lang.Cloneable
{

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

    /**
     * What the latest version in the directory is, including
     * snapshots.
     */
    private String latest;

    /**
     * What the latest version in the directory is, of the releases
     * only.
     */
    private String release;

    /**
     * The current snapshot data in use for this version (artifact
     * snapshots only).
     */
    private Snapshot snapshot;

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

    /**
     * When the metadata was last updated.
     */
    private String lastUpdated;

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


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

    /**
     * Method addSnapshotVersion.
     * 
     * @param snapshotVersion
     */
    public void addSnapshotVersion( SnapshotVersion snapshotVersion )
    {
        getSnapshotVersions().add( snapshotVersion );
    } //-- void addSnapshotVersion( SnapshotVersion )

    /**
     * Method addVersion.
     * 
     * @param string
     */
    public void addVersion( String string )
    {
        getVersions().add( string );
    } //-- void addVersion( String )

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

            if ( this.snapshot != null )
            {
                copy.snapshot = (Snapshot) this.snapshot.clone();
            }

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

            if ( this.snapshotVersions != null )
            {
                copy.snapshotVersions = new java.util.ArrayList();
                for ( SnapshotVersion item : this.snapshotVersions )
                {
                    copy.snapshotVersions.add( ( (SnapshotVersion) 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 );
        }
    } //-- Versioning clone()

    /**
     * Get when the metadata was last updated.
     * 
     * @return String
     */
    public String getLastUpdated()
    {
        return this.lastUpdated;
    } //-- String getLastUpdated()

    /**
     * Get what the latest version in the directory is, including
     * snapshots.
     * 
     * @return String
     */
    public String getLatest()
    {
        return this.latest;
    } //-- String getLatest()

    /**
     * Get what the latest version in the directory is, of the
     * releases only.
     * 
     * @return String
     */
    public String getRelease()
    {
        return this.release;
    } //-- String getRelease()

    /**
     * Get the current snapshot data in use for this version
     * (artifact snapshots only).
     * 
     * @return Snapshot
     */
    public Snapshot getSnapshot()
    {
        return this.snapshot;
    } //-- Snapshot getSnapshot()

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

        return this.snapshotVersions;
    } //-- java.util.List getSnapshotVersions()

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

        return this.versions;
    } //-- java.util.List getVersions()

    /**
     * Method removeSnapshotVersion.
     * 
     * @param snapshotVersion
     */
    public void removeSnapshotVersion( SnapshotVersion snapshotVersion )
    {
        getSnapshotVersions().remove( snapshotVersion );
    } //-- void removeSnapshotVersion( SnapshotVersion )

    /**
     * Method removeVersion.
     * 
     * @param string
     */
    public void removeVersion( String string )
    {
        getVersions().remove( string );
    } //-- void removeVersion( String )

    /**
     * Set when the metadata was last updated.
     * 
     * @param lastUpdated
     */
    public void setLastUpdated( String lastUpdated )
    {
        this.lastUpdated = lastUpdated;
    } //-- void setLastUpdated( String )

    /**
     * Set what the latest version in the directory is, including
     * snapshots.
     * 
     * @param latest
     */
    public void setLatest( String latest )
    {
        this.latest = latest;
    } //-- void setLatest( String )

    /**
     * Set what the latest version in the directory is, of the
     * releases only.
     * 
     * @param release
     */
    public void setRelease( String release )
    {
        this.release = release;
    } //-- void setRelease( String )

    /**
     * Set the current snapshot data in use for this version
     * (artifact snapshots only).
     * 
     * @param snapshot
     */
    public void setSnapshot( Snapshot snapshot )
    {
        this.snapshot = snapshot;
    } //-- void setSnapshot( Snapshot )

    /**
     * Set information for each sub-artifact available in this
     * artifact snapshot.
     * 
     * @param snapshotVersions
     */
    public void setSnapshotVersions( java.util.List snapshotVersions )
    {
        this.snapshotVersions = snapshotVersions;
    } //-- void setSnapshotVersions( java.util.List )

    /**
     * Set versions available of the artifact (both releases and
     * snapshots).
     * 
     * @param versions
     */
    public void setVersions( java.util.List versions )
    {
        this.versions = versions;
    } //-- void setVersions( java.util.List )

    
    public void updateTimestamp()
    {
        setLastUpdatedTimestamp( new java.util.Date() );
    }

    public void setLastUpdatedTimestamp( java.util.Date date )
    {
        java.util.TimeZone timezone = java.util.TimeZone.getTimeZone( "UTC" );
        java.text.DateFormat fmt = new java.text.SimpleDateFormat( "yyyyMMddHHmmss" );
        fmt.setTimeZone( timezone );
        setLastUpdated( fmt.format( date ) );
    }
          
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy