Interface Artifact

All Known Implementing Classes:
DefaultArtifact

public interface Artifact
An abstract entity uniquely identified by its coordinates – group identifier, artifact identifier, extension, classifier and version, with optionally associated artifact file.

Artifact objects are immutable – all methods which modify artifact return a new object and keep the original unmodified.

Author:
Mikolaj Izdebski
  • Field Details

  • Method Details

    • getGroupId

      String getGroupId()
      Get group identifier of this artifact.
      Returns:
      artifact group identifier, never null.
    • getArtifactId

      String getArtifactId()
      Get artifact identifier of this artifact.
      Returns:
      artifact identifier, never null.
    • getExtension

      String getExtension()
      Get extension of this artifact.
      Returns:
      artifact extension, never null.
    • getClassifier

      String getClassifier()
      Get classifier of this artifact.
      Returns:
      artifact classifier, never null.
    • getVersion

      String getVersion()
      Get version of this artifact.
      Returns:
      artifact version, never null.
    • getPath

      Path getPath()
      Get local path of artifact file or null if artifact is not resolved (doesn't have associated artifact file).
      Returns:
      artifact file path, can be null.
    • setVersion

      Artifact setVersion(String version)
      Set artifact version.

      Since artifacts are immutable, this method returns a new object and leaves the original unmodified.

      Parameters:
      version - the new artifact version to set
      Returns:
      copy of artifact with the new version set
    • setPath

      Artifact setPath(Path path)
      Set artifact path.

      Since artifacts are immutable, this method returns a new object and leaves the original unmodified.

      Parameters:
      path - the new artifact path to set
      Returns:
      copy of artifact with the new path set