public final class JkCoordinate
extends java.lang.Object
The coordinate pattern is expressed as follows:
group:name
group:name:version
group:name:classifier(s):version
group:name:classifier(s):type:version
Notes:
'?'
if unspecified'+'
to select the highest available versionModifier and Type | Class and Description |
---|---|
static class |
JkCoordinate.ConflictStrategy |
static class |
JkCoordinate.JkArtifactSpecification
When declaring a module dependency, we implicitly request for the main artifact of this module.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
cacheFileName() |
java.nio.file.Path |
cachePath() |
boolean |
equals(java.lang.Object o) |
JkCoordinate.JkArtifactSpecification |
getArtifactSpecification()
Returns the
JkCoordinate.JkArtifactSpecification for this module dependency. |
JkModuleId |
getModuleId()
Returns the getModuleId of this dependency.
|
JkVersion |
getVersion()
Returns the version of the module this dependency is constrained to.
|
int |
hashCode() |
boolean |
hasUnspecifiedVersion()
Returns
true if the version of the module for this dependency is not specified. |
static boolean |
isCoordinateDescription(java.lang.String candidate)
Returns
true if the specified candidate matches to a module description. |
boolean |
isTransitiveByDefault() |
static JkCoordinate |
of(JkModuleId jkModuleId)
Creates a
JkCoordinate to the specified getModuleId with unspecified version |
static JkCoordinate |
of(JkModuleId jkModuleId,
JkVersion version)
Creates a
JkCoordinate to the specified getModuleId and
JkVersion . |
static JkCoordinate |
of(JkModuleId jkModuleId,
java.lang.String version)
Creates a
JkCoordinate of the specified moduleId and version range. |
static JkCoordinate |
of(java.lang.String coordinate,
java.lang.Object... tokens)
Creates a new
JkCoordinate from the given string representation of a dependency coordinate. |
static JkCoordinate |
of(java.lang.String group,
java.lang.String name,
java.lang.String version)
Creates a
JkCoordinate to its group, name and version
range. |
JkCoordinate |
resolveConflict(JkVersion other,
JkCoordinate.ConflictStrategy strategy) |
java.lang.String |
toString() |
JkCoordinate |
withClassifier(java.lang.String classifier) |
JkCoordinate |
withClassifierAndType(java.lang.String classifiers,
java.lang.String type)
Returns a JkModuleDependency identical to this one but with the specified
classifiers and type as the only
JkCoordinate.JkArtifactSpecification for this dependency |
JkCoordinate |
withClassifiers(java.lang.String classifier) |
JkCoordinate |
withVersion(JkVersion version)
Returns a JkModuleDependency identical to this one but with the specified
static version.
|
JkCoordinate |
withVersion(java.lang.String version) |
public static JkCoordinate of(JkModuleId jkModuleId)
JkCoordinate
to the specified getModuleId with unspecified versionpublic static JkCoordinate of(JkModuleId jkModuleId, JkVersion version)
JkCoordinate
to the specified getModuleId and
JkVersion
.public static JkCoordinate of(JkModuleId jkModuleId, java.lang.String version)
JkCoordinate
of the specified moduleId and version range.public static JkCoordinate of(java.lang.String group, java.lang.String name, java.lang.String version)
JkCoordinate
to its group, name and version
range. The version range can be any string accepted by
JkVersion.of(String)
.public static JkCoordinate of(java.lang.String coordinate, java.lang.Object... tokens)
JkCoordinate
from the given string representation of a dependency coordinate.
Tjava.lang.IllegalArgumentException
- if the coordinate format does not adhere to the expected pattern.public boolean isTransitiveByDefault()
public static boolean isCoordinateDescription(java.lang.String candidate)
true
if the specified candidate matches to a module description.public JkModuleId getModuleId()
public JkVersion getVersion()
public boolean hasUnspecifiedVersion()
true
if the version of the module for this dependency is not specified.public JkCoordinate withVersion(JkVersion version)
null
then returned version is this one.public JkCoordinate withVersion(java.lang.String version)
public JkCoordinate withClassifiers(java.lang.String classifier)
withClassifierAndType(String, String)
public JkCoordinate withClassifierAndType(java.lang.String classifiers, java.lang.String type)
JkCoordinate.JkArtifactSpecification
for this dependencyclassifiers
- classifiers separated with ','. Example 'linux,max' stands for
linux and mac classifier. ',mac' stands for the default classifier +
mac classifierpublic JkCoordinate withClassifier(java.lang.String classifier)
withClassifierAndType(String, String)
public JkCoordinate.JkArtifactSpecification getArtifactSpecification()
JkCoordinate.JkArtifactSpecification
for this module dependency.public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.nio.file.Path cachePath()
public java.lang.String cacheFileName()
public JkCoordinate resolveConflict(JkVersion other, JkCoordinate.ConflictStrategy strategy)