All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.clarolab.bamboo.entities.BambooResult Maven / Gradle / Ivy

Go to download

This library allows to extract information from projects, plans and builds on Bamboo

There is a newer version: 1.8
Show newest version
package com.clarolab.bamboo.entities;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.util.List;
import java.util.stream.Collectors;

@Getter
@Setter
@ToString
public class BambooResult extends BambooBase{

    private String planName;
    private String projectName;
    private String buildResultKey;
    private String lifeCycleState;
    private long id;
    private String buildStartedTime;
    private String buildCompletedTime;
    private long buildDuration;
    private String buildState;
    private int buildNumber;
    @ToString.Exclude
    private BambooArtifacts artifacts;
    @ToString.Exclude
    private BambooStages stages;

    public List getArtifacts(){
        if(stages != null && stages.hasStages())
            return stages.getAllArtifacts();
        return artifacts.getArtifacts();
    }

    public List getStages(){
        return stages.getStages();
    }

    public String getUrl(){
        return getLink().getHref().replaceFirst("rest/api/.*/result", "browse");
    }

    public List getJobKeys(){
        return getArtifacts().stream().map(artifact -> artifact.getJobKey()).distinct().collect(Collectors.toList());
    }

    public String getStartTime(){
        return buildStartedTime;
    }

    public long getDuration(){
        return buildDuration;
    }

    public String getStatus(){
        return buildState;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy