public class ArtifactId extends Object implements Comparable<ArtifactId>
jar is assumed.
This class is not thread-safe.| Constructor and Description |
|---|
ArtifactId(String groupId,
String artifactId,
String version,
String classifier,
String type)
Create a new artifact object
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(ArtifactId o) |
boolean |
equals(Object o) |
static ArtifactId |
fromMvnId(String coordinates)
Create a new artifact id from maven coordinates/id
groupId:artifactId[:packaging[:classifier]]:version
|
static ArtifactId |
fromMvnUrl(String url)
Create a new artifact id from a maven url,
'mvn:' group-id '/' artifact-id [ '/' [version] [ '/' [type] [ '/' classifier ] ] ] ]
|
String |
getArtifactId()
Return the artifact id.
|
String |
getClassifier()
Return the optional classifier.
|
String |
getGroupId()
Return the group id.
|
org.osgi.framework.Version |
getOSGiVersion()
Return the OSGi version
|
String |
getType()
Return the type.
|
String |
getVersion()
Return the version.
|
int |
hashCode() |
boolean |
isSame(ArtifactId id)
Test whether the artifact id is pointing to the same artifact but potentially a different version
|
static ArtifactId |
parse(String s)
Create a new artifact id from a string, the string must either be a
mvn url or a mvn id (= coordinates)
|
String |
toMvnId()
Return a mvn id
|
String |
toMvnPath()
Create a Maven like relative repository path.
|
String |
toMvnUrl()
Return a mvn url
|
String |
toString() |
public ArtifactId(String groupId, String artifactId, String version, String classifier, String type)
groupId - The group id (required)artifactId - The artifact id (required)version - The version (required)classifier - The classifier (optional)type - The type/extension (optional, defaults to jar)IllegalArgumentException - If group id, artifact id or version are null or if
the version is not a valid version.public static ArtifactId parse(String s)
s - The string to parseIllegalArgumentException - if the string can't be parsed to a valid artifact id.public static ArtifactId fromMvnUrl(String url)
url - The urlIllegalArgumentException - If the url is not validpublic static ArtifactId fromMvnId(String coordinates)
coordinates - The coordinates as outlined aboveIllegalArgumentException - If the id is not validpublic String toMvnUrl()
fromMvnUrl(String)public String toMvnId()
fromMvnId(String)public String getGroupId()
public String getArtifactId()
public String getClassifier()
null.public String getType()
public String getVersion()
public boolean isSame(ArtifactId id)
id - The artifact idtrue if group id, artifact id, type and classifier equalpublic org.osgi.framework.Version getOSGiVersion()
public String toMvnPath()
public int compareTo(ArtifactId o)
compareTo in interface Comparable<ArtifactId>Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.