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

uk.co.codera.ci.tooling.application.CiToolingConfiguration Maven / Gradle / Ivy

Go to download

Reponsible for wiring together the DropWizard configuration and application. Builds the runnable jar.

There is a newer version: 0.2.4
Show newest version
package uk.co.codera.ci.tooling.application;

import com.fasterxml.jackson.annotation.JsonProperty;

import io.dropwizard.Configuration;

public class CiToolingConfiguration extends Configuration {

    @JsonProperty
    private BitBucketConfiguration bitBucket;

    @JsonProperty
    private JenkinsConfiguration jenkins;

    @JsonProperty
    private SonarConfiguration sonar;

    @JsonProperty
    private SvnConfiguration svn;

    public CiToolingConfiguration() {
        super();
    }

    private CiToolingConfiguration(Builder builder) {
        this();
        this.sonar = builder.sonarConfiguration;
        this.jenkins = builder.jenkinsConfiguration;
        this.bitBucket = builder.bitBucketConfiguration;
        this.svn = builder.svnConfiguration;
    }

    public static Builder someCiToolingConfiguration() {
        return new Builder();
    }

    public BitBucketConfiguration getBitBucket() {
        return this.bitBucket;
    }

    public JenkinsConfiguration getJenkins() {
        return this.jenkins;
    }

    public SonarConfiguration getSonar() {
        return this.sonar;
    }

    public SvnConfiguration getSvn() {
        return this.svn;
    }

    public boolean isBitBucketConfigured() {
        return getBitBucket() != null;
    }

    public boolean isJenkinsConfigured() {
        return getJenkins() != null;
    }

    public boolean isSonarConfigured() {
        return getSonar() != null;
    }

    public boolean isSvnConfigured() {
        return getSvn() != null;
    }

    public static class Builder {

        private SonarConfiguration sonarConfiguration;
        private JenkinsConfiguration jenkinsConfiguration;
        private BitBucketConfiguration bitBucketConfiguration;
        private SvnConfiguration svnConfiguration;

        private Builder() {
            super();
        }

        public Builder with(SonarConfiguration.Builder sonarConfiguration) {
            this.sonarConfiguration = sonarConfiguration.build();
            return this;
        }

        public Builder with(JenkinsConfiguration.Builder jenkinsConfiguration) {
            this.jenkinsConfiguration = jenkinsConfiguration.build();
            return this;
        }

        public Builder with(BitBucketConfiguration.Builder bitBucketConfiguration) {
            this.bitBucketConfiguration = bitBucketConfiguration.build();
            return this;
        }

        public Builder with(SvnConfiguration.Builder svnConfiguration) {
            this.svnConfiguration = svnConfiguration.build();
            return this;
        }

        public CiToolingConfiguration build() {
            return new CiToolingConfiguration(this);
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy