Package org.eclipse.aether.util.artifact
Class ArtifactIdUtils
- java.lang.Object
-
- org.eclipse.aether.util.artifact.ArtifactIdUtils
-
public final class ArtifactIdUtils extends java.lang.ObjectA utility class for artifact identifiers.
-
-
Field Summary
Fields Modifier and Type Field Description private static charSEP
-
Constructor Summary
Constructors Modifier Constructor Description privateArtifactIdUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static java.lang.StringBuilderconcat(java.lang.String groupId, java.lang.String artifactId, java.lang.String extension, java.lang.String classifier)static booleanequalsBaseId(Artifact artifact1, Artifact artifact2)Determines whether two artifacts have the same base identifier.static booleanequalsId(Artifact artifact1, Artifact artifact2)Determines whether two artifacts have the same identifier.static booleanequalsVersionlessId(Artifact artifact1, Artifact artifact2)Determines whether two artifacts have the same versionless identifier.static java.lang.StringtoBaseId(Artifact artifact)Creates an artifact identifier of the form<groupId>:<artifactId>:<extension>[:<classifier>]:<baseVersion>.static java.lang.StringtoId(java.lang.String groupId, java.lang.String artifactId, java.lang.String extension, java.lang.String classifier, java.lang.String version)Creates an artifact identifier of the form<groupId>:<artifactId>:<extension>[:<classifier>]:<version>.static java.lang.StringtoId(Artifact artifact)Creates an artifact identifier of the form<groupId>:<artifactId>:<extension>[:<classifier>]:<version>.static java.lang.StringtoVersionlessId(java.lang.String groupId, java.lang.String artifactId, java.lang.String extension, java.lang.String classifier)Creates an artifact identifier of the form<groupId>:<artifactId>:<extension>[:<classifier>].static java.lang.StringtoVersionlessId(Artifact artifact)Creates an artifact identifier of the form<groupId>:<artifactId>:<extension>[:<classifier>].
-
-
-
Field Detail
-
SEP
private static final char SEP
- See Also:
- Constant Field Values
-
-
Method Detail
-
toId
public static java.lang.String toId(Artifact artifact)
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 java.lang.String toId(java.lang.String groupId, java.lang.String artifactId, java.lang.String extension, java.lang.String classifier, java.lang.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
public static java.lang.String toBaseId(Artifact artifact)
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
public static java.lang.String toVersionlessId(Artifact artifact)
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 java.lang.String toVersionlessId(java.lang.String groupId, java.lang.String artifactId, java.lang.String extension, java.lang.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.
-
concat
private static java.lang.StringBuilder concat(java.lang.String groupId, java.lang.String artifactId, java.lang.String extension, java.lang.String classifier)
-
equalsId
public static boolean equalsId(Artifact artifact1, 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(Artifact artifact1, 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(Artifact artifact1, 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.
-
-