public final class ArtifactIdUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static char |
SEP |
Modifier | Constructor and Description |
---|---|
private |
ArtifactIdUtils() |
Modifier and Type | Method and Description |
---|---|
private static java.lang.StringBuilder |
concat(java.lang.String groupId,
java.lang.String artifactId,
java.lang.String extension,
java.lang.String classifier) |
private static <T> boolean |
eq(T s1,
T s2) |
static boolean |
equalsBaseId(Artifact artifact1,
Artifact artifact2)
Determines whether two artifacts have the same base identifier.
|
static boolean |
equalsId(Artifact artifact1,
Artifact artifact2)
Determines whether two artifacts have the same identifier.
|
static boolean |
equalsVersionlessId(Artifact artifact1,
Artifact artifact2)
Determines whether two artifacts have the same versionless identifier.
|
static java.lang.String |
toBaseId(Artifact artifact)
Creates an artifact identifier of the form
<groupId>:<artifactId>:<extension>[:<classifier>]:<baseVersion> . |
static java.lang.String |
toId(Artifact artifact)
Creates an artifact identifier of the form
<groupId>:<artifactId>:<extension>[:<classifier>]:<version> . |
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> . |
static java.lang.String |
toVersionlessId(Artifact artifact)
Creates an artifact identifier of the form
<groupId>:<artifactId>:<extension>[:<classifier>] . |
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>] . |
private static final char SEP
public static java.lang.String toId(Artifact artifact)
<groupId>:<artifactId>:<extension>[:<classifier>]:<version>
.artifact
- The artifact to create an identifer for, may be null
.null
if the input was null
.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)
<groupId>:<artifactId>:<extension>[:<classifier>]:<version>
.groupId
- The group id, may be null
.artifactId
- The artifact id, may be null
.extension
- The file extensiion, may be null
.classifier
- The classifier, may be null
.version
- The version, may be null
.null
.public static java.lang.String toBaseId(Artifact artifact)
<groupId>:<artifactId>:<extension>[:<classifier>]:<baseVersion>
.artifact
- The artifact to create an identifer for, may be null
.null
if the input was null
.public static java.lang.String toVersionlessId(Artifact artifact)
<groupId>:<artifactId>:<extension>[:<classifier>]
.artifact
- The artifact to create an identifer for, may be null
.null
if the input was null
.public static java.lang.String toVersionlessId(java.lang.String groupId, java.lang.String artifactId, java.lang.String extension, java.lang.String classifier)
<groupId>:<artifactId>:<extension>[:<classifier>]
.groupId
- The group id, may be null
.artifactId
- The artifact id, may be null
.extension
- The file extensiion, may be null
.classifier
- The classifier, may be null
.null
.private static java.lang.StringBuilder concat(java.lang.String groupId, java.lang.String artifactId, java.lang.String extension, java.lang.String classifier)
public static boolean equalsId(Artifact artifact1, Artifact artifact2)
String.equals(Object)
on the return values from toId(Artifact)
for the artifacts but does not
incur the overhead of creating temporary strings.artifact1
- The first artifact, may be null
.artifact2
- The second artifact, may be null
.true
if both artifacts are not null
and have equal ids, false
otherwise.public static boolean equalsBaseId(Artifact artifact1, Artifact artifact2)
String.equals(Object)
on the return values from toBaseId(Artifact)
for the artifacts but does
not incur the overhead of creating temporary strings.artifact1
- The first artifact, may be null
.artifact2
- The second artifact, may be null
.true
if both artifacts are not null
and have equal base ids, false
otherwise.public static boolean equalsVersionlessId(Artifact artifact1, Artifact artifact2)
String.equals(Object)
on the return values from toVersionlessId(Artifact)
for the artifacts but
does not incur the overhead of creating temporary strings.artifact1
- The first artifact, may be null
.artifact2
- The second artifact, may be null
.true
if both artifacts are not null
and have equal versionless ids, false
otherwise.private static <T> boolean eq(T s1, T s2)