com.capitalone.dashboard.model.HudsonCollector Maven / Gradle / Ivy
package com.capitalone.dashboard.model;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
/**
* Extension of Collector that stores current build server configuration.
*/
public class HudsonCollector extends Collector {
private List buildServers = new ArrayList<>();
private List niceNames = new ArrayList<>();
public List getBuildServers() {
return buildServers;
}
public List getNiceNames() {
return niceNames;
}
public void setNiceNames(List niceNames) {
this.niceNames = niceNames;
}
public void setBuildServers(List buildServers) {
this.buildServers = buildServers;
}
public static HudsonCollector prototype(List buildServers, List niceNames) {
HudsonCollector protoType = new HudsonCollector();
protoType.setName("Hudson");
protoType.setCollectorType(CollectorType.Build);
protoType.setOnline(true);
protoType.setEnabled(true);
protoType.getBuildServers().addAll(buildServers);
if (!CollectionUtils.isEmpty(niceNames)) {
protoType.getNiceNames().addAll(niceNames);
}
return protoType;
}
}