- java.lang.Object
-
- org.jboss.modules.maven.ArtifactCoordinates
-
public final class ArtifactCoordinates extends Object
Maven artifact coordinate specification.- Author:
- David M. Lloyd
-
-
Constructor Summary
Constructors Constructor Description ArtifactCoordinates(String groupId, String artifactId, String version)
Construct a new instance with an empty classifier.ArtifactCoordinates(String groupId, String artifactId, String version, String classifier)
Construct a new instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
Determine whether this coordinates object equals the target object.boolean
equals(ArtifactCoordinates obj)
Determine whether this coordinates object equals the target object.static ArtifactCoordinates
fromString(String string)
Parse a string and produce artifact coordinates from it.String
getArtifactId()
Get the artifact ID.String
getClassifier()
Get the classifier.String
getGroupId()
Get the group ID.String
getVersion()
Get the version.int
hashCode()
Get the hash code.String
relativeArtifactPath()
Create a relative repository path for the given artifact coordinates with a'/'
separator.String
relativeArtifactPath(char separator)
Create a relative repository path for the given artifact coordinates.String
toString()
Get the string representation.
-
-
-
Constructor Detail
-
ArtifactCoordinates
public ArtifactCoordinates(String groupId, String artifactId, String version, String classifier)
Construct a new instance.- Parameters:
groupId
- the group ID (must not benull
)artifactId
- the artifact ID (must not benull
)version
- the version string (must not benull
)classifier
- the classifier string (must not benull
, may be empty)
-
-
Method Detail
-
fromString
public static ArtifactCoordinates fromString(String string)
Parse a string and produce artifact coordinates from it.- Parameters:
string
- the string to parse (must not benull
)- Returns:
- the artifact coordinates object (not
null
)
-
getGroupId
public String getGroupId()
Get the group ID.- Returns:
- the group ID (not
null
)
-
getArtifactId
public String getArtifactId()
Get the artifact ID.- Returns:
- the artifact ID (not
null
)
-
getVersion
public String getVersion()
Get the version.- Returns:
- the version (not
null
)
-
getClassifier
public String getClassifier()
Get the classifier.- Returns:
- the classifier (not
null
, may be empty)
-
relativeArtifactPath
public String relativeArtifactPath(char separator)
Create a relative repository path for the given artifact coordinates.- Parameters:
separator
- the separator character to use (typically'/'
orFile.separatorChar
)- Returns:
- the path string
-
relativeArtifactPath
public String relativeArtifactPath()
Create a relative repository path for the given artifact coordinates with a'/'
separator.- Returns:
- the path string
-
equals
public boolean equals(Object obj)
Determine whether this coordinates object equals the target object.
-
equals
public boolean equals(ArtifactCoordinates obj)
Determine whether this coordinates object equals the target object.- Parameters:
obj
- the target object- Returns:
true
if the object is equal to this one,false
otherwise
-
hashCode
public int hashCode()
Get the hash code.
-
-