public final class Artifact extends Object implements Serializable, Comparable<Artifact>
Comparable to sort based on
getGroupId() and then getName().| Constructor and Description |
|---|
Artifact(String groupId,
String artifactId,
String version,
String type)
An artifact.
|
Artifact(String groupId,
String artifactId,
String version,
String type,
long timestamp,
int buildNumber)
A timestamped snapshot artifact.
|
Artifact(String groupId,
String artifactId,
String version,
String classifier,
String type)
A classified snapshot artifact.
|
Artifact(String groupId,
String artifactId,
String version,
String classifier,
String type,
long timestamp,
int buildNumber)
A timestamped classified snapshot artifact.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Artifact that) |
boolean |
equals(Object o) |
boolean |
equalSnapshots(Artifact artifact)
More lax version of
equals(Object) that matches SNAPSHOTs with their corresponding timestamped versions. |
String |
getArtifactId()
Returns the artifactId of the artifact.
|
Integer |
getBuildNumber()
Returns the build number of the artifact (may be
null). |
String |
getClassifier()
Returns the classifier of the artifact (may be
null). |
String |
getGroupId()
Returns the groupId of the artifact.
|
String |
getName()
Returns the name of the artifact.
|
Long |
getTimestamp()
Returns the timestamp of the artifact (may be
null). |
String |
getTimestampString()
Returns the timestamp (formatted as a
yyyyMMdd.HHmmss string) of the artifact
(may be null). |
String |
getTimestampVersion()
Returns the timestamp version.
|
String |
getType()
Returns the type of the artifact.
|
String |
getVersion()
Returns the version of the artifact.
|
int |
hashCode() |
boolean |
isSnapshot()
Returns
true if and only if the artifact is a SNAPSHOT artifact. |
String |
toString() |
public Artifact(String groupId, String artifactId, String version, String classifier, String type, long timestamp, int buildNumber)
groupId - The groupId.artifactId - The artifactId.version - The version.classifier - The classifier (or null).type - The type.timestamp - The timestamp.buildNumber - The build number.public Artifact(String groupId, String artifactId, String version, String type, long timestamp, int buildNumber)
groupId - The groupId.artifactId - The artifactId.version - The version.type - The type.timestamp - The timestamp.buildNumber - The build number.public Artifact(String groupId, String artifactId, String version, String classifier, String type)
groupId - The groupId.artifactId - The artifactId.version - The version.classifier - The classifier (or null).type - The type.public String getName()
public String getGroupId()
public String getArtifactId()
public String getVersion()
public String getType()
public String getClassifier()
null).null).public Long getTimestamp()
null).null).public Integer getBuildNumber()
null).null).public String getTimestampString()
yyyyMMdd.HHmmss string) of the artifact
(may be null).yyyyMMdd.HHmmss string) of the artifact
(may be null).public String getTimestampVersion()
getVersion().getVersion().getVersion() with
SNAPSHOT replaced by getTimestampString() and the getBuildNumber() separated
by a -.public boolean isSnapshot()
true if and only if the artifact is a SNAPSHOT artifact.true if and only if the artifact is a SNAPSHOT artifact.public boolean equalSnapshots(Artifact artifact)
equals(Object) that matches SNAPSHOTs with their corresponding timestamped versions.artifact - the artifact to compare with.true if this artifact is the same as the specified artifact (where timestamps are ignored
for SNAPSHOT versions).public int compareTo(Artifact that)
compareTo in interface Comparable<Artifact>Copyright © 2009–2022 MojoHaus. All rights reserved.