Package org.jboss.modules.maven
Class ArtifactCoordinates
java.lang.Object
org.jboss.modules.maven.ArtifactCoordinates
Maven artifact coordinate specification.
- Author:
- David M. Lloyd
-
Constructor Summary
ConstructorsConstructorDescriptionArtifactCoordinates
(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
Modifier and TypeMethodDescriptionboolean
Determine whether this coordinates object equals the target object.boolean
Determine whether this coordinates object equals the target object.static ArtifactCoordinates
fromString
(String string) Parse a string and produce artifact coordinates from it.Get the artifact ID.Get the classifier.Get the group ID.Get the version.int
hashCode()
Get the hash code.Create a relative repository path for the given artifact coordinates with a'/'
separator.relativeArtifactPath
(char separator) Create a relative repository path for the given artifact coordinates.toString()
Get the string representation.
-
Constructor Details
-
ArtifactCoordinates
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)
-
ArtifactCoordinates
Construct a new instance with an empty classifier.- Parameters:
groupId
- the group ID (must not benull
)artifactId
- the artifact ID (must not benull
)version
- the version string (must not benull
)
-
-
Method Details
-
fromString
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
Get the group ID.- Returns:
- the group ID (not
null
)
-
getArtifactId
Get the artifact ID.- Returns:
- the artifact ID (not
null
)
-
getVersion
Get the version.- Returns:
- the version (not
null
)
-
getClassifier
Get the classifier.- Returns:
- the classifier (not
null
, may be empty)
-
relativeArtifactPath
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
Create a relative repository path for the given artifact coordinates with a'/'
separator.- Returns:
- the path string
-
equals
Determine whether this coordinates object equals the target object. -
equals
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. -
toString
Get the string representation.
-