public abstract class AbstractArtifact extends java.lang.Object implements Artifact
| Modifier and Type | Field and Description |
|---|---|
private static java.lang.String |
SNAPSHOT |
private static java.util.regex.Pattern |
SNAPSHOT_TIMESTAMP |
| Constructor and Description |
|---|
AbstractArtifact() |
| Modifier and Type | Method and Description |
|---|---|
protected static java.util.Map<java.lang.String,java.lang.String> |
copyProperties(java.util.Map<java.lang.String,java.lang.String> properties)
Copies the specified artifact properties.
|
private static <T> boolean |
eq(T s1,
T s2) |
boolean |
equals(java.lang.Object obj)
Compares this artifact with the specified object.
|
java.lang.String |
getBaseVersion()
Gets the base version of this artifact, for example "1.0-SNAPSHOT".
|
java.lang.String |
getProperty(java.lang.String key,
java.lang.String defaultValue)
Gets the specified property.
|
private static int |
hash(java.lang.Object obj) |
int |
hashCode()
Returns a hash code for this artifact.
|
boolean |
isSnapshot()
Determines whether this artifact uses a snapshot version.
|
private static boolean |
isSnapshot(java.lang.String version) |
private Artifact |
newInstance(java.lang.String version,
java.util.Map<java.lang.String,java.lang.String> properties,
java.io.File file)
Creates a new artifact with the specified coordinates, properties and file.
|
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 the artifact.
|
private static java.lang.String |
toBaseVersion(java.lang.String version) |
java.lang.String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitgetArtifactId, getClassifier, getExtension, getFile, getGroupId, getProperties, getVersionprivate static final java.lang.String SNAPSHOT
private static final java.util.regex.Pattern SNAPSHOT_TIMESTAMP
public boolean isSnapshot()
ArtifactisSnapshot in interface Artifacttrue if the artifact is a snapshot, false otherwise.private static boolean isSnapshot(java.lang.String version)
public java.lang.String getBaseVersion()
ArtifactArtifact.getVersion(), the
base version will always refer to the unresolved meta version.getBaseVersion in interface Artifactnull.private static java.lang.String toBaseVersion(java.lang.String version)
private Artifact newInstance(java.lang.String version, java.util.Map<java.lang.String,java.lang.String> properties, java.io.File file)
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, i.e. need not copy it.file - The resolved file of the artifact, may be null.null.public Artifact setVersion(java.lang.String version)
ArtifactsetVersion in interface Artifactversion - The version of this artifact, may be null or empty.null.public Artifact setFile(java.io.File file)
Artifactpublic Artifact setProperties(java.util.Map<java.lang.String,java.lang.String> properties)
ArtifactsetProperties in interface Artifactproperties - The properties for the artifact, may be null.null.ArtifactPropertiespublic java.lang.String getProperty(java.lang.String key,
java.lang.String defaultValue)
ArtifactgetProperty in interface Artifactkey - 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.ArtifactPropertiesprotected static java.util.Map<java.lang.String,java.lang.String> copyProperties(java.util.Map<java.lang.String,java.lang.String> properties)
properties - The properties to copy, may be null.null.public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - 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.private static <T> boolean eq(T s1,
T s2)
public int hashCode()
hashCode in class java.lang.Objectprivate static int hash(java.lang.Object obj)