Package org.fedoraproject.xmvn.artifact
Interface Artifact
- All Known Implementing Classes:
DefaultArtifact
public interface Artifact
Represents an abstract software artifact uniquely identified by its coordinates, which include
the group identifier, artifact identifier, extension, classifier, and version. An artifact may
optionally be associated with a local file path.
Artifact instances are immutable. Any modification results in a new object, leaving the original unchanged.
This interface defines methods for retrieving artifact metadata and creating modified copies with updated properties.
- Author:
- Mikolaj Izdebski
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDefault extension used when no explicit extension is specified.static final StringDefault version used when no explicit version is specified.static final StringManifest key for storing the artifact identifier.static final StringManifest key for storing the artifact classifier.static final StringManifest key for storing the artifact extension.static final StringManifest key for storing the group identifier.static final StringManifest key for storing the artifact version. -
Method Summary
Modifier and TypeMethodDescriptionReturns the artifact identifier of this artifact.Returns the classifier of this artifact.Returns the extension of this artifact.Returns the group identifier of this artifact.getPath()Returns the local file path of the artifact, ornullif the artifact is unresolved (i.e., has no associated file).Returns the version of this artifact.static ArtifactFactory method to create an artifact instance from a coordinate string.static ArtifactFactory method to create an artifact with a group ID and artifact ID.static ArtifactFactory method to create an artifact with a group ID, artifact ID, and version.static ArtifactFactory method to create an artifact with a group ID, artifact ID, extension, and version.static ArtifactFactory method to create an artifact with full coordinates.static Artifactof(String groupId, String artifactId, String extension, String classifier, String version, Path path) Factory method to create an artifact with full coordinates and a local file path.default ArtifactDeprecated.default ArtifactsetVersion(String version) Deprecated.UsewithVersion(String)instead.Creates a new artifact instance with the specified file path.withVersion(String version) Creates a new artifact instance with the specified version.
-
Field Details
-
DEFAULT_EXTENSION
Default extension used when no explicit extension is specified.- See Also:
-
DEFAULT_VERSION
Default version used when no explicit version is specified.- See Also:
-
MF_KEY_GROUPID
Manifest key for storing the group identifier.- See Also:
-
MF_KEY_ARTIFACTID
Manifest key for storing the artifact identifier.- See Also:
-
MF_KEY_EXTENSION
Manifest key for storing the artifact extension.- See Also:
-
MF_KEY_CLASSIFIER
Manifest key for storing the artifact classifier.- See Also:
-
MF_KEY_VERSION
Manifest key for storing the artifact version.- See Also:
-
-
Method Details
-
getGroupId
String getGroupId()Returns the group identifier of this artifact.- Returns:
- the group identifier, never
null
-
getArtifactId
String getArtifactId()Returns the artifact identifier of this artifact.- Returns:
- the artifact identifier, never
null
-
getExtension
String getExtension()Returns the extension of this artifact.- Returns:
- the artifact extension, never
null
-
getClassifier
String getClassifier()Returns the classifier of this artifact.- Returns:
- the artifact classifier, never
null
-
getVersion
String getVersion()Returns the version of this artifact.- Returns:
- the artifact version, never
null
-
getPath
Path getPath()Returns the local file path of the artifact, ornullif the artifact is unresolved (i.e., has no associated file).- Returns:
- the artifact file path, or
nullif not resolved
-
withVersion
Creates a new artifact instance with the specified version.- Parameters:
version- the new version to set- Returns:
- a new artifact instance with the updated version
-
setVersion
Deprecated.UsewithVersion(String)instead. -
withPath
Creates a new artifact instance with the specified file path.- Parameters:
path- the new file path to set- Returns:
- a new artifact instance with the updated path
-
setPath
Deprecated.UsewithPath(Path)instead. -
of
Factory method to create an artifact instance from a coordinate string.- Parameters:
coords- the artifact coordinates- Returns:
- a new artifact instance
-
of
Factory method to create an artifact with a group ID and artifact ID.- Parameters:
groupId- the group identifierartifactId- the artifact identifier- Returns:
- a new artifact instance
-
of
Factory method to create an artifact with a group ID, artifact ID, and version.- Parameters:
groupId- the group identifierartifactId- the artifact identifierversion- the artifact version- Returns:
- a new artifact instance
-
of
Factory method to create an artifact with a group ID, artifact ID, extension, and version.- Parameters:
groupId- the group identifierartifactId- the artifact identifierextension- the artifact extensionversion- the artifact version- Returns:
- a new artifact instance
-
of
static Artifact of(String groupId, String artifactId, String extension, String classifier, String version) Factory method to create an artifact with full coordinates.- Parameters:
groupId- the group identifierartifactId- the artifact identifierextension- the artifact extensionclassifier- the artifact classifierversion- the artifact version- Returns:
- a new artifact instance
-
of
static Artifact of(String groupId, String artifactId, String extension, String classifier, String version, Path path) Factory method to create an artifact with full coordinates and a local file path.- Parameters:
groupId- the group identifierartifactId- the artifact identifierextension- the artifact extensionclassifier- the artifact classifierversion- the artifact versionpath- the local file path- Returns:
- a new artifact instance
-
withPath(Path)instead.