public final class ArtifactCoordinates
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
artifactId |
private java.lang.String |
classifier |
private java.lang.String |
groupId |
private int |
hashCode |
(package private) static java.util.regex.Pattern |
snapshotPattern |
private java.lang.String |
toString |
private static java.util.regex.Pattern |
VALID_PATTERN |
private java.lang.String |
version |
Constructor and Description |
---|
ArtifactCoordinates(java.lang.String groupId,
java.lang.String artifactId,
java.lang.String version)
Construct a new instance with an empty classifier.
|
ArtifactCoordinates(java.lang.String groupId,
java.lang.String artifactId,
java.lang.String version,
java.lang.String classifier)
Construct a new instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(ArtifactCoordinates obj)
Determine whether this coordinates object equals the target object.
|
boolean |
equals(java.lang.Object obj)
Determine whether this coordinates object equals the target object.
|
static ArtifactCoordinates |
fromString(java.lang.String string)
Parse a string and produce artifact coordinates from it.
|
java.lang.String |
getArtifactId()
Get the artifact ID.
|
java.lang.String |
getClassifier()
Get the classifier.
|
java.lang.String |
getGroupId()
Get the group ID.
|
java.lang.String |
getVersion()
Get the version.
|
int |
hashCode()
Get the hash code.
|
java.lang.String |
relativeArtifactPath()
Create a relative repository path for the given artifact coordinates with a
'/' separator. |
java.lang.String |
relativeArtifactPath(char separator)
Create a relative repository path for the given artifact coordinates.
|
java.lang.String |
toString()
Get the string representation.
|
static final java.util.regex.Pattern snapshotPattern
private static final java.util.regex.Pattern VALID_PATTERN
private final java.lang.String groupId
private final java.lang.String artifactId
private final java.lang.String version
private final java.lang.String classifier
private int hashCode
private java.lang.String toString
public ArtifactCoordinates(java.lang.String groupId, java.lang.String artifactId, java.lang.String version, java.lang.String classifier)
groupId
- the group ID (must not be null
)artifactId
- the artifact ID (must not be null
)version
- the version string (must not be null
)classifier
- the classifier string (must not be null
, may be empty)public ArtifactCoordinates(java.lang.String groupId, java.lang.String artifactId, java.lang.String version)
groupId
- the group ID (must not be null
)artifactId
- the artifact ID (must not be null
)version
- the version string (must not be null
)public static ArtifactCoordinates fromString(java.lang.String string)
string
- the string to parse (must not be null
)null
)public java.lang.String getGroupId()
null
)public java.lang.String getArtifactId()
null
)public java.lang.String getVersion()
null
)public java.lang.String getClassifier()
null
, may be empty)public java.lang.String relativeArtifactPath(char separator)
separator
- the separator character to use (typically '/'
or File.separatorChar
)public java.lang.String relativeArtifactPath()
'/'
separator.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the target objecttrue
if the object is equal to this one, false
otherwisepublic boolean equals(ArtifactCoordinates obj)
obj
- the target objecttrue
if the object is equal to this one, false
otherwisepublic int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object