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

io.alauda.devops.api.model.BuildTriggerCauseBuilder Maven / Gradle / Ivy

There is a newer version: 0.2.12
Show newest version
package io.alauda.devops.api.model;

import io.alauda.kubernetes.api.builder.VisitableBuilder;
import java.lang.Object;
import java.lang.Boolean;

public class BuildTriggerCauseBuilder extends BuildTriggerCauseFluentImpl implements VisitableBuilder{

    BuildTriggerCauseFluent fluent;
    Boolean validationEnabled;

    public BuildTriggerCauseBuilder(){
            this(true);
    }
    public BuildTriggerCauseBuilder(Boolean validationEnabled){
            this(new BuildTriggerCause(), validationEnabled);
    }
    public BuildTriggerCauseBuilder(BuildTriggerCauseFluent fluent){
            this(fluent, true);
    }
    public BuildTriggerCauseBuilder(BuildTriggerCauseFluent fluent,Boolean validationEnabled){
            this(fluent, new BuildTriggerCause(), validationEnabled);
    }
    public BuildTriggerCauseBuilder(BuildTriggerCauseFluent fluent,BuildTriggerCause instance){
            this(fluent, instance, true);
    }
    public BuildTriggerCauseBuilder(BuildTriggerCauseFluent fluent,BuildTriggerCause instance,Boolean validationEnabled){
            this.fluent = fluent; 
            fluent.withBitbucketWebHook(instance.getBitbucketWebHook()); 
            fluent.withGenericWebHook(instance.getGenericWebHook()); 
            fluent.withGithubWebHook(instance.getGithubWebHook()); 
            fluent.withGitlabWebHook(instance.getGitlabWebHook()); 
            fluent.withImageChangeBuild(instance.getImageChangeBuild()); 
            fluent.withMessage(instance.getMessage()); 
            this.validationEnabled = validationEnabled; 
    }
    public BuildTriggerCauseBuilder(BuildTriggerCause instance){
            this(instance,true);
    }
    public BuildTriggerCauseBuilder(BuildTriggerCause instance,Boolean validationEnabled){
            this.fluent = this; 
            this.withBitbucketWebHook(instance.getBitbucketWebHook()); 
            this.withGenericWebHook(instance.getGenericWebHook()); 
            this.withGithubWebHook(instance.getGithubWebHook()); 
            this.withGitlabWebHook(instance.getGitlabWebHook()); 
            this.withImageChangeBuild(instance.getImageChangeBuild()); 
            this.withMessage(instance.getMessage()); 
            this.validationEnabled = validationEnabled; 
    }

    public BuildTriggerCause build(){
            BuildTriggerCause buildable = new BuildTriggerCause(fluent.getBitbucketWebHook(),fluent.getGenericWebHook(),fluent.getGithubWebHook(),fluent.getGitlabWebHook(),fluent.getImageChangeBuild(),fluent.getMessage());
            io.alauda.kubernetes.api.builder.ValidationUtils.validate(buildable);
            return buildable;
    }

    public boolean equals(Object o){
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            if (!super.equals(o)) return false;
            BuildTriggerCauseBuilder that = (BuildTriggerCauseBuilder) o;
            if (fluent != null &&fluent != this ? !fluent.equals(that.fluent) :that.fluent != null &&fluent != this ) return false;

            if (validationEnabled != null ? !validationEnabled.equals(that.validationEnabled) :that.validationEnabled != null) return false;
            return true;
    }




}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy