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{

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

    public List getArtifacts(){
        if(stages != null)
            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());
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy