org.sonatype.aether.util.artifact
Class DelegatingArtifact

java.lang.Object
  extended by org.sonatype.aether.util.artifact.AbstractArtifact
      extended by org.sonatype.aether.util.artifact.DelegatingArtifact
All Implemented Interfaces:
Artifact

public abstract class DelegatingArtifact
extends AbstractArtifact

An artifact that delegates to another artifact instance. This class serves as a base for subclasses that want to carry additional data fields.


Constructor Summary
protected DelegatingArtifact(Artifact delegate)
          Creates a new artifact instance that delegates to the specified artifact.
 
Method Summary
 boolean equals(Object obj)
           
 String getArtifactId()
           
 String getBaseVersion()
           
 String getClassifier()
           
 String getExtension()
           
 File getFile()
           
 String getGroupId()
           
 Map<String,String> getProperties()
           
 String getProperty(String key, String defaultValue)
           
 String getVersion()
           
 int hashCode()
           
 boolean isSnapshot()
           
protected abstract  DelegatingArtifact newInstance(Artifact delegate)
          Creates a new artifact instance that delegates to the specified artifact.
 Artifact setFile(File file)
           
 Artifact setProperties(Map<String,String> properties)
           
 Artifact setVersion(String version)
           
 String toString()
           
 
Methods inherited from class org.sonatype.aether.util.artifact.AbstractArtifact
isSnapshot, newInstance, toBaseVersion
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DelegatingArtifact

protected DelegatingArtifact(Artifact delegate)
Creates a new artifact instance that delegates to the specified artifact.

Parameters:
delegate - The artifact to delegate to, must not be null.
Method Detail

newInstance

protected abstract DelegatingArtifact newInstance(Artifact delegate)
Creates a new artifact instance that delegates to the specified artifact. Subclasses should use this hook to instantiate themselves, taking along any data from the current instance that was added.

Parameters:
delegate - The artifact to delegate to, must not be null.
Returns:
The new delegating artifact, never null.

getGroupId

public String getGroupId()

getArtifactId

public String getArtifactId()

getVersion

public String getVersion()

setVersion

public Artifact setVersion(String version)
Specified by:
setVersion in interface Artifact
Overrides:
setVersion in class AbstractArtifact

getBaseVersion

public String getBaseVersion()

isSnapshot

public boolean isSnapshot()

getClassifier

public String getClassifier()

getExtension

public String getExtension()

getFile

public File getFile()

setFile

public Artifact setFile(File file)
Specified by:
setFile in interface Artifact
Overrides:
setFile in class AbstractArtifact

getProperty

public String getProperty(String key,
                          String defaultValue)

getProperties

public Map<String,String> getProperties()

setProperties

public Artifact setProperties(Map<String,String> properties)
Specified by:
setProperties in interface Artifact
Overrides:
setProperties in class AbstractArtifact

equals

public boolean equals(Object obj)
Overrides:
equals in class AbstractArtifact

hashCode

public int hashCode()
Overrides:
hashCode in class AbstractArtifact

toString

public String toString()
Overrides:
toString in class AbstractArtifact


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