// =================== DO NOT EDIT THIS FILE ====================
// Generated by Modello 1.11,
// any modifications will be overwritten.
// ==============================================================
package org.apache.maven.artifact.repository.metadata;
Versioning information for an artifact (un-versioned or
snapshot).
Version: $Revision$ $Date$
/**
* 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.
/**
* 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.
/**
* 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).
/**
* The current snapshot data in use for this version (artifact
* snapshots only).
*/
private Snapshot snapshot;
Field versions.
/**
* Field versions.
*/
private java.util.List<String> versions;
When the metadata was last updated.
/**
* When the metadata was last updated.
*/
private String lastUpdated;
Field snapshotVersions.
/**
* Field snapshotVersions.
*/
private java.util.List<SnapshotVersion> snapshotVersions;
//-----------/
//- Methods -/
//-----------/
Method addSnapshotVersion.
Params: - snapshotVersion –
/**
* Method addSnapshotVersion.
*
* @param snapshotVersion
*/
public void addSnapshotVersion( SnapshotVersion snapshotVersion )
{
getSnapshotVersions().add( snapshotVersion );
} //-- void addSnapshotVersion( SnapshotVersion )
Method addVersion.
Params: - string –
/**
* Method addVersion.
*
* @param string
*/
public void addVersion( String string )
{
getVersions().add( string );
} //-- void addVersion( String )
Method clone.
Returns: Versioning
/**
* 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<String>();
copy.versions.addAll( this.versions );
}
if ( this.snapshotVersions != null )
{
copy.snapshotVersions = new java.util.ArrayList<SnapshotVersion>();
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.
Returns: String
/**
* 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.
Returns: String
/**
* 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.
Returns: String
/**
* 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).
Returns: Snapshot
/**
* 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.
Returns: List
/**
* Method getSnapshotVersions.
*
* @return List
*/
public java.util.List<SnapshotVersion> getSnapshotVersions()
{
if ( this.snapshotVersions == null )
{
this.snapshotVersions = new java.util.ArrayList<SnapshotVersion>();
}
return this.snapshotVersions;
} //-- java.util.List<SnapshotVersion> getSnapshotVersions()
Method getVersions.
Returns: List
/**
* Method getVersions.
*
* @return List
*/
public java.util.List<String> getVersions()
{
if ( this.versions == null )
{
this.versions = new java.util.ArrayList<String>();
}
return this.versions;
} //-- java.util.List<String> getVersions()
Method removeSnapshotVersion.
Params: - snapshotVersion –
/**
* Method removeSnapshotVersion.
*
* @param snapshotVersion
*/
public void removeSnapshotVersion( SnapshotVersion snapshotVersion )
{
getSnapshotVersions().remove( snapshotVersion );
} //-- void removeSnapshotVersion( SnapshotVersion )
Method removeVersion.
Params: - string –
/**
* Method removeVersion.
*
* @param string
*/
public void removeVersion( String string )
{
getVersions().remove( string );
} //-- void removeVersion( String )
Set when the metadata was last updated.
Params: - lastUpdated –
/**
* 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.
Params: - latest –
/**
* 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.
Params: - release –
/**
* 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).
Params: - snapshot –
/**
* 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.
Params: - snapshotVersions –
/**
* Set information for each sub-artifact available in this
* artifact snapshot.
*
* @param snapshotVersions
*/
public void setSnapshotVersions( java.util.List<SnapshotVersion> snapshotVersions )
{
this.snapshotVersions = snapshotVersions;
} //-- void setSnapshotVersions( java.util.List )
Set versions available of the artifact (both releases and
snapshots).
Params: - versions –
/**
* Set versions available of the artifact (both releases and
* snapshots).
*
* @param versions
*/
public void setVersions( java.util.List<String> 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 ) );
}
}