public abstract class DelegatingArtifact extends AbstractArtifact
| Modifier | Constructor and Description |
|---|---|
protected |
DelegatingArtifact(Artifact delegate)
Creates a new artifact instance that delegates to the specified artifact.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj)
Compares this artifact with the specified object.
|
String |
getArtifactId()
Gets the artifact identifier of this artifact, for example "maven-model".
|
String |
getBaseVersion()
Gets the base version of this artifact, for example "1.0-SNAPSHOT".
|
String |
getClassifier()
Gets the classifier of this artifact, for example "sources".
|
String |
getExtension()
Gets the (file) extension of this artifact, for example "jar" or "tar.gz".
|
File |
getFile()
Gets the file of this artifact.
|
String |
getGroupId()
Gets the group identifier of this artifact, for example "org.apache.maven".
|
Map<String,String> |
getProperties()
Gets the properties of this artifact.
|
String |
getProperty(String key,
String defaultValue)
Gets the specified property.
|
String |
getVersion()
Gets the version of this artifact, for example "1.0-20100529-1213".
|
int |
hashCode()
Returns a hash code for this artifact.
|
boolean |
isSnapshot()
Determines whether this artifact uses a snapshot version.
|
protected abstract DelegatingArtifact |
newInstance(Artifact delegate)
Creates a new artifact instance that delegates to the specified artifact.
|
Artifact |
setFile(File file)
Sets the file of the artifact.
|
Artifact |
setProperties(Map<String,String> properties)
Sets the properties for the artifact.
|
Artifact |
setVersion(String version)
Sets the version of the artifact.
|
String |
toString() |
copyPropertiesprotected DelegatingArtifact(Artifact delegate)
delegate - The artifact to delegate to, must not be null.protected abstract DelegatingArtifact newInstance(Artifact delegate)
delegate - The artifact to delegate to, must not be null.null.public String getGroupId()
Artifactnull.public String getArtifactId()
Artifactnull.public String getVersion()
Artifactnull.public Artifact setVersion(String version)
ArtifactsetVersion in interface ArtifactsetVersion in class AbstractArtifactversion - The version of this artifact, may be null or empty.null.public String getBaseVersion()
ArtifactArtifact.getVersion(), the
base version will always refer to the unresolved meta version.getBaseVersion in interface ArtifactgetBaseVersion in class AbstractArtifactnull.public boolean isSnapshot()
ArtifactisSnapshot in interface ArtifactisSnapshot in class AbstractArtifacttrue if the artifact is a snapshot, false otherwise.public String getClassifier()
Artifactnull.public String getExtension()
Artifactnull.public File getFile()
Artifactnull if the artifact isn't resolved.public Artifact setFile(File file)
ArtifactsetFile in interface ArtifactsetFile in class AbstractArtifactfile - The file of the artifact, may be nullnull.public String getProperty(String key, String defaultValue)
ArtifactgetProperty in interface ArtifactgetProperty in class AbstractArtifactkey - The name of the property, must not be null.defaultValue - The default value to return in case the property is not set, may be null.null if the property is not set and no default value was
provided.ArtifactPropertiespublic Map<String,String> getProperties()
Artifactnull.ArtifactPropertiespublic Artifact setProperties(Map<String,String> properties)
ArtifactsetProperties in interface ArtifactsetProperties in class AbstractArtifactproperties - The properties for the artifact, may be null.null.ArtifactPropertiespublic boolean equals(Object obj)
AbstractArtifactequals in class AbstractArtifactobj - The object to compare this artifact against, may be null.true if and only if the specified object is another Artifact with equal coordinates,
properties and file, false otherwise.public int hashCode()
AbstractArtifacthashCode in class AbstractArtifactpublic String toString()
toString in class AbstractArtifactCopyright © 2010-2014 The Eclipse Foundation. All Rights Reserved.