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

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

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(){
        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