public class Artifact extends Commentable implements java.lang.Comparable
Constructor and Description |
---|
Artifact(java.lang.String gId,
java.lang.String aId,
java.lang.String version,
java.lang.String classifier,
java.lang.String type)
Create a new artifact object
|
Artifact(java.lang.String gId,
java.lang.String aId,
java.lang.String version,
java.lang.String classifier,
java.lang.String type,
java.util.Map<java.lang.String,java.lang.String> metadata)
Create a new artifact object
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(java.lang.Object o) |
boolean |
equals(java.lang.Object o) |
static Artifact |
fromMvnUrl(java.lang.String url)
Create a new artifact from a maven url,
'mvn:' [ repository-url '!' ] group-id '/' artifact-id [ '/' [version] [ '/' [type] [ '/' classifier ] ] ] ]
|
java.lang.String |
getArtifactId()
Return the artifact id.
|
java.lang.String |
getClassifier()
Return the optional classifier.
|
java.lang.String |
getGroupId()
Return the group id.
|
java.util.Map<java.lang.String,java.lang.String> |
getMetadata()
Get the metadata of the artifact.
|
java.lang.String |
getRepositoryPath()
Create a Maven like relative repository path.
|
java.lang.String |
getType()
Return the type.
|
java.lang.String |
getVersion()
Return the version.
|
int |
hashCode() |
java.lang.String |
toMvnUrl()
Return a mvn url
|
java.lang.String |
toString() |
getComment, setComment
getLocation, setLocation
public Artifact(java.lang.String gId, java.lang.String aId, java.lang.String version, java.lang.String classifier, java.lang.String type)
gId
- The group id (required)aId
- The artifact id (required)version
- The version (required)classifier
- The classifier (optional)type
- The type/extension (optional, defaults to jar)public Artifact(java.lang.String gId, java.lang.String aId, java.lang.String version, java.lang.String classifier, java.lang.String type, java.util.Map<java.lang.String,java.lang.String> metadata)
gId
- The group id (required)aId
- The artifact id (required)version
- The version (required)classifier
- The classifier (optional)type
- The type/extension (optional, defaults to jar)metadata
- The metadata associated with the Artifactpublic static Artifact fromMvnUrl(java.lang.String url)
url
- The urljava.lang.IllegalArgumentException
- If the url is not validpublic int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
public java.lang.String toMvnUrl()
fromMvnUrl(String)
public java.lang.String getGroupId()
public java.lang.String getArtifactId()
public java.lang.String getVersion()
public java.lang.String getClassifier()
public java.lang.String getType()
public java.util.Map<java.lang.String,java.lang.String> getMetadata()
public java.lang.String getRepositoryPath()
public java.lang.String toString()
toString
in class Commentable
Copyright © 2018 The Apache Software Foundation. All rights reserved.