Package org.eclipse.aether.util.artifact
Class ArtifactIdUtils
java.lang.Object
org.eclipse.aether.util.artifact.ArtifactIdUtils
A utility class for artifact identifiers.
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
equalsBaseId
(org.eclipse.aether.artifact.Artifact artifact1, org.eclipse.aether.artifact.Artifact artifact2) Determines whether two artifacts have the same base identifier.static boolean
equalsId
(org.eclipse.aether.artifact.Artifact artifact1, org.eclipse.aether.artifact.Artifact artifact2) Determines whether two artifacts have the same identifier.static boolean
equalsVersionlessId
(org.eclipse.aether.artifact.Artifact artifact1, org.eclipse.aether.artifact.Artifact artifact2) Determines whether two artifacts have the same versionless identifier.static String
toBaseId
(org.eclipse.aether.artifact.Artifact artifact) Creates an artifact identifier of the form<groupId>:<artifactId>:<extension>[:<classifier>]:<baseVersion>
.static String
Creates an artifact identifier of the form<groupId>:<artifactId>:<extension>[:<classifier>]:<version>
.static String
toId
(org.eclipse.aether.artifact.Artifact artifact) Creates an artifact identifier of the form<groupId>:<artifactId>:<extension>[:<classifier>]:<version>
.static String
toVersionlessId
(String groupId, String artifactId, String extension, String classifier) Creates an artifact identifier of the form<groupId>:<artifactId>:<extension>[:<classifier>]
.static String
toVersionlessId
(org.eclipse.aether.artifact.Artifact artifact) Creates an artifact identifier of the form<groupId>:<artifactId>:<extension>[:<classifier>]
.
-
Method Details
-
toId
Creates an artifact identifier of the form<groupId>:<artifactId>:<extension>[:<classifier>]:<version>
.- Parameters:
artifact
- The artifact to create an identifer for, may benull
.- Returns:
- The artifact identifier or
null
if the input wasnull
.
-
toId
public static String toId(String groupId, String artifactId, String extension, String classifier, String version) Creates an artifact identifier of the form<groupId>:<artifactId>:<extension>[:<classifier>]:<version>
.- Parameters:
groupId
- The group id, may benull
.artifactId
- The artifact id, may benull
.extension
- The file extensiion, may benull
.classifier
- The classifier, may benull
.version
- The version, may benull
.- Returns:
- The artifact identifier, never
null
.
-
toBaseId
Creates an artifact identifier of the form<groupId>:<artifactId>:<extension>[:<classifier>]:<baseVersion>
.- Parameters:
artifact
- The artifact to create an identifer for, may benull
.- Returns:
- The artifact identifier or
null
if the input wasnull
.
-
toVersionlessId
Creates an artifact identifier of the form<groupId>:<artifactId>:<extension>[:<classifier>]
.- Parameters:
artifact
- The artifact to create an identifer for, may benull
.- Returns:
- The artifact identifier or
null
if the input wasnull
.
-
toVersionlessId
public static String toVersionlessId(String groupId, String artifactId, String extension, String classifier) Creates an artifact identifier of the form<groupId>:<artifactId>:<extension>[:<classifier>]
.- Parameters:
groupId
- The group id, may benull
.artifactId
- The artifact id, may benull
.extension
- The file extensiion, may benull
.classifier
- The classifier, may benull
.- Returns:
- The artifact identifier, never
null
.
-
equalsId
public static boolean equalsId(org.eclipse.aether.artifact.Artifact artifact1, org.eclipse.aether.artifact.Artifact artifact2) Determines whether two artifacts have the same identifier. This method is equivalent to callingString.equals(Object)
on the return values fromtoId(Artifact)
for the artifacts but does not incur the overhead of creating temporary strings.- Parameters:
artifact1
- The first artifact, may benull
.artifact2
- The second artifact, may benull
.- Returns:
true
if both artifacts are notnull
and have equal ids,false
otherwise.
-
equalsBaseId
public static boolean equalsBaseId(org.eclipse.aether.artifact.Artifact artifact1, org.eclipse.aether.artifact.Artifact artifact2) Determines whether two artifacts have the same base identifier. This method is equivalent to callingString.equals(Object)
on the return values fromtoBaseId(Artifact)
for the artifacts but does not incur the overhead of creating temporary strings.- Parameters:
artifact1
- The first artifact, may benull
.artifact2
- The second artifact, may benull
.- Returns:
true
if both artifacts are notnull
and have equal base ids,false
otherwise.
-
equalsVersionlessId
public static boolean equalsVersionlessId(org.eclipse.aether.artifact.Artifact artifact1, org.eclipse.aether.artifact.Artifact artifact2) Determines whether two artifacts have the same versionless identifier. This method is equivalent to callingString.equals(Object)
on the return values fromtoVersionlessId(Artifact)
for the artifacts but does not incur the overhead of creating temporary strings.- Parameters:
artifact1
- The first artifact, may benull
.artifact2
- The second artifact, may benull
.- Returns:
true
if both artifacts are notnull
and have equal versionless ids,false
otherwise.
-