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

com.capitalone.dashboard.model.HudsonCollector Maven / Gradle / Ivy

There is a newer version: 3.2.0
Show newest version
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;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy