Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright (c) 2013 Cosmin Stejerean, Karl Heinz Marbaise, and contributors.
*
* Distributed under the MIT license: http://opensource.org/licenses/MIT
*/
package com.offbytwo.jenkins.model;
import com.google.common.base.Predicate;
import com.google.common.base.Strings;
import com.google.common.collect.ImmutableMap;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.*;
import static com.google.common.collect.Collections2.filter;
/**
* This class represents build information with details about what has been done
* like duration start and of course the build result.
*
*/
public class BuildWithDetails extends Build {
/**
* This will be returned by the API in cases where the build has never run.
* For example {@link Build#BUILD_HAS_NEVER_RUN}
*/
public static final BuildWithDetails BUILD_HAS_NEVER_RUN = new BuildWithDetails() {
@Override
public List getActions() {
return Collections.emptyList();
}
@Override
public List getArtifacts() {
return Collections.emptyList();
}
@Override
public List getCauses() {
return Collections.emptyList();
}
@Override
public List getCulprits() {
return Collections.emptyList();
}
@Override
public BuildResult getResult() {
return BuildResult.NOT_BUILT;
}
};
/**
* This will be returned by the API in cases where the build has been
* cancelled. For example {@link Build#BUILD_HAS_BEEN_CANCELLED}
*/
public static final BuildWithDetails BUILD_HAS_BEEN_CANCELLED = new BuildWithDetails() {
@Override
public List getActions() {
return Collections.emptyList();
}
@Override
public List getArtifacts() {
return Collections.emptyList();
}
@Override
public List getCauses() {
return Collections.emptyList();
}
@Override
public List getCulprits() {
return Collections.emptyList();
}
@Override
public BuildResult getResult() {
return BuildResult.CANCELLED;
}
};
private List actions; // TODO: Should be improved.
private boolean building;
private String description;
private String displayName;
private long duration;
private long estimatedDuration;
private String fullDisplayName;
private String id;
private long timestamp;
private BuildResult result;
private List artifacts;
private String consoleOutputText;
private String consoleOutputHtml;
private BuildChangeSet changeSet;
private String builtOn;
private List culprits;
public BuildWithDetails() {
// Default ctor is needed to jackson.
}
public BuildWithDetails(BuildWithDetails details) {
this.actions = details.actions;
this.description = details.description;
this.displayName = details.displayName;
this.building = details.building;
this.duration = details.duration;
this.estimatedDuration = details.estimatedDuration;
this.fullDisplayName = details.fullDisplayName;
this.id = details.id;
this.timestamp = details.timestamp;
this.result = details.result;
this.artifacts = details.artifacts;
this.consoleOutputHtml = details.consoleOutputHtml;
this.consoleOutputText = details.consoleOutputText;
this.changeSet = details.changeSet;
this.builtOn = details.builtOn;
this.culprits = details.culprits;
this.setClient(details.getClient());
}
public List getArtifacts() {
return artifacts;
}
public boolean isBuilding() {
return building;
}
public List getCauses() {
// actions is a List