public final class JkArtifactId
extends java.lang.Object
JkArtifactId
identifies artifacts within a project.
The identifier is compound of a name and a file extension. The name maps with the Maven 'classifier' concept.
In a project, we distinguish the main artifact from the others : the main artifact name values to empty string.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
MAIN_ARTIFACT_NAME |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
java.lang.String |
getExtension()
Returns the file getExtension of this object.
|
java.lang.String |
getName()
Returns the classifier of this object.
|
int |
hashCode() |
boolean |
isMainArtifact() |
static JkArtifactId |
of(java.lang.String name,
java.lang.String extension)
Creates an artifact id with the specified name and extension.
|
static JkArtifactId |
ofMainArtifact(java.lang.String extension)
Shorthand for
of(MAIN_ARTIFACT_NAME, String) . |
java.lang.String |
toFileName(java.lang.String namePart) |
java.lang.String |
toString() |
public static final java.lang.String MAIN_ARTIFACT_NAME
public static JkArtifactId of(java.lang.String name, java.lang.String extension)
The name cannot be null or be a string composed of spaces.
An empty string extension generally means that the file has no extension.
public static JkArtifactId ofMainArtifact(java.lang.String extension)
of(MAIN_ARTIFACT_NAME, String)
.public boolean isMainArtifact()
public java.lang.String getName()
public java.lang.String getExtension()
public java.lang.String toFileName(java.lang.String namePart)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object