org.sonatype.aether.util.artifact
Class AbstractArtifact
java.lang.Object
org.sonatype.aether.util.artifact.AbstractArtifact
- All Implemented Interfaces:
- Artifact
- Direct Known Subclasses:
- DefaultArtifact, DelegatingArtifact, SubArtifact
public abstract class AbstractArtifact
- extends Object
- implements Artifact
A skeleton class for artifacts that implements Object.equals(Object), Object.hashCode() and
Object.toString().
- Author:
- Benjamin Bentmann
AbstractArtifact
public AbstractArtifact()
isSnapshot
protected static boolean isSnapshot(String version)
toBaseVersion
protected static String toBaseVersion(String version)
newInstance
protected Artifact newInstance(String groupId,
String artifactId,
String classifier,
String extension,
String version,
Map<String,String> properties,
File file)
- Creates a new artifact with the specified coordinates, properties and file.
- Parameters:
groupId - The group identifier of the artifact, may be null.artifactId - The artifact identifier of the artifact, may be null.classifier - The classifier of the artifact, may be null.extension - The file extension of the artifact, may be null.version - The version of the artifact, may be null.properties - The properties of the artifact, may be null if none. The method may assume immutability
of the supplied map.file - The resolved file of the artifact, may be null.
setVersion
public Artifact setVersion(String version)
- Specified by:
setVersion in interface Artifact
setFile
public Artifact setFile(File file)
- Specified by:
setFile in interface Artifact
setProperties
public Artifact setProperties(Map<String,String> properties)
- Specified by:
setProperties in interface Artifact
toString
public String toString()
- Overrides:
toString in class Object
equals
public boolean equals(Object obj)
- Overrides:
equals in class Object
hashCode
public int hashCode()
- Overrides:
hashCode in class Object
Copyright © 2010-2011 Sonatype, Inc.. All Rights Reserved.