Class ArtifactItem


  • public class ArtifactItem
    extends EntityPropertiesBuilder<ArtifactItemProperties>
    Represents an artifact or group of artifacts, obtained using one of the following methods.
    • declared in the job (as local or shared artifact)
    • subscribed by the job (from a job from a previous stage)
    • downloaded using Artifact Downloader task (from another plan)
    Examples:
     // all artifacts from a current plan
     new ArtifactItem()
    
     // an artifact from a current plan
     new ArtifactItem()
         .artifact("name")
    
     // an artifact from another plan
     new ArtifactItem()
         .sourcePlan(new PlanIdentifier("PROJ", "PLAN"))
         .artifact("name")
     
    • Constructor Detail

      • ArtifactItem

        public ArtifactItem()
    • Method Detail

      • sourcePlan

        public ArtifactItem sourcePlan​(@NotNull
                                       @NotNull PlanIdentifier planIdentifier)
        Specify from which plan a downloaded artifact shall be taken. Note that by using few Artifact Downloader tasks you can download several artifacts having the same name. This is to distinguish them. In case a source plan is not specified, the current plan will be used.
        Parameters:
        planIdentifier - a project-plan key, e.g. "MYPROJECT-MYPLAN"
        Returns:
        ArtifactItem this
      • artifact

        public ArtifactItem artifact​(@NotNull
                                     @NotNull java.lang.String artifactName)
        Specify that only one downloaded artifact shall be taken.
        Parameters:
        artifactName - name of the downloaded artifact
        Returns:
        ArtifactItem this
      • allArtifacts

        public ArtifactItem allArtifacts()
        Specify that all downloaded artifacts shall be taken.
        Returns:
        ArtifactItem this
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object