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 booleanequalsBaseId(org.eclipse.aether.artifact.Artifact artifact1, org.eclipse.aether.artifact.Artifact artifact2) Determines whether two artifacts have the same base identifier.static booleanequalsId(org.eclipse.aether.artifact.Artifact artifact1, org.eclipse.aether.artifact.Artifact artifact2) Determines whether two artifacts have the same identifier.static booleanequalsVersionlessId(org.eclipse.aether.artifact.Artifact artifact1, org.eclipse.aether.artifact.Artifact artifact2) Determines whether two artifacts have the same versionless identifier.static StringtoBaseId(org.eclipse.aether.artifact.Artifact artifact) Creates an artifact identifier of the form<groupId>:<artifactId>:<extension>[:<classifier>]:<baseVersion>.static StringCreates an artifact identifier of the form<groupId>:<artifactId>:<extension>[:<classifier>]:<version>.static StringtoId(org.eclipse.aether.artifact.Artifact artifact) Creates an artifact identifier of the form<groupId>:<artifactId>:<extension>[:<classifier>]:<version>.static StringtoVersionlessId(String groupId, String artifactId, String extension, String classifier) Creates an artifact identifier of the form<groupId>:<artifactId>:<extension>[:<classifier>].static StringtoVersionlessId(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
nullif 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
nullif 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
nullif 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:
trueif both artifacts are notnulland have equal ids,falseotherwise.
-
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:
trueif both artifacts are notnulland have equal base ids,falseotherwise.
-
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:
trueif both artifacts are notnulland have equal versionless ids,falseotherwise.
-