org.sonatype.aether.util.artifact
Class AbstractArtifact

java.lang.Object
  extended by org.sonatype.aether.util.artifact.AbstractArtifact
All Implemented Interfaces:
Artifact
Direct Known Subclasses:
DefaultArtifact, SubArtifact

public abstract class AbstractArtifact
extends java.lang.Object
implements Artifact

A skeleton class for artifacts that implements Object.equals(Object), Object.hashCode() and Object.toString().

Author:
Benjamin Bentmann

Constructor Summary
AbstractArtifact()
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 int hashCode()
           
protected static boolean isSnapshot(java.lang.String version)
           
 Artifact setFile(java.io.File file)
          Sets the file of the artifact.
 Artifact setProperties(java.util.Map<java.lang.String,java.lang.String> properties)
          Sets the properties for the artifact.
 Artifact setVersion(java.lang.String version)
          Sets the version of this artifact.
protected static java.lang.String toBaseVersion(java.lang.String version)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.sonatype.aether.artifact.Artifact
getArtifactId, getBaseVersion, getClassifier, getExtension, getFile, getGroupId, getProperties, getProperty, getVersion, isSnapshot
 

Constructor Detail

AbstractArtifact

public AbstractArtifact()
Method Detail

isSnapshot

protected static boolean isSnapshot(java.lang.String version)

toBaseVersion

protected static java.lang.String toBaseVersion(java.lang.String version)

setVersion

public Artifact setVersion(java.lang.String version)
Description copied from interface: Artifact
Sets the version of this artifact.

Specified by:
setVersion in interface Artifact
Parameters:
version - The version of this artifact, may be null.
Returns:
The new artifact, never null.

setFile

public Artifact setFile(java.io.File file)
Description copied from interface: Artifact
Sets the file of the artifact.

Specified by:
setFile in interface Artifact
Parameters:
file - The file of the artifact, may be null
Returns:
The new artifact, never null.

setProperties

public Artifact setProperties(java.util.Map<java.lang.String,java.lang.String> properties)
Description copied from interface: Artifact
Sets the properties for the artifact.

Specified by:
setProperties in interface Artifact
Parameters:
properties - The properties for the artifact, may be null.
Returns:
The new artifact, never null.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object


Copyright © 2010-2011 Sonatype, Inc.. All Rights Reserved.