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

io.dekorate.halkyon.config.ComponentConfigBuilder Maven / Gradle / Ivy

There is a newer version: 2.0.0.beta2
Show newest version
package io.dekorate.halkyon.config;

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

public class ComponentConfigBuilder extends ComponentConfigFluentImpl implements VisitableBuilder{

    ComponentConfigFluent fluent;
    Boolean validationEnabled;

    public ComponentConfigBuilder(){
            this(true);
    }
    public ComponentConfigBuilder(Boolean validationEnabled){
            this(new ComponentConfig(), validationEnabled);
    }
    public ComponentConfigBuilder(ComponentConfigFluent fluent){
            this(fluent, true);
    }
    public ComponentConfigBuilder(ComponentConfigFluent fluent,Boolean validationEnabled){
            this(fluent, new ComponentConfig(), validationEnabled);
    }
    public ComponentConfigBuilder(ComponentConfigFluent fluent,ComponentConfig instance){
            this(fluent, instance, true);
    }
    public ComponentConfigBuilder(ComponentConfigFluent fluent,ComponentConfig instance,Boolean validationEnabled){
            this.fluent = fluent; 
            fluent.withProject(instance.getProject()); 
            fluent.withAttributes(instance.getAttributes()); 
            fluent.withPartOf(instance.getPartOf()); 
            fluent.withName(instance.getName()); 
            fluent.withVersion(instance.getVersion()); 
            fluent.withDeploymentMode(instance.getDeploymentMode()); 
            fluent.withExposeService(instance.isExposeService()); 
            fluent.withEnvs(instance.getEnvs()); 
            fluent.withLabels(instance.getLabels()); 
            fluent.withBuildType(instance.getBuildType()); 
            fluent.withRemote(instance.getRemote()); 
            fluent.withProvides(instance.getProvides()); 
            fluent.withRequires(instance.getRequires()); 
            this.validationEnabled = validationEnabled; 
    }
    public ComponentConfigBuilder(ComponentConfig instance){
            this(instance,true);
    }
    public ComponentConfigBuilder(ComponentConfig instance,Boolean validationEnabled){
            this.fluent = this; 
            this.withProject(instance.getProject()); 
            this.withAttributes(instance.getAttributes()); 
            this.withPartOf(instance.getPartOf()); 
            this.withName(instance.getName()); 
            this.withVersion(instance.getVersion()); 
            this.withDeploymentMode(instance.getDeploymentMode()); 
            this.withExposeService(instance.isExposeService()); 
            this.withEnvs(instance.getEnvs()); 
            this.withLabels(instance.getLabels()); 
            this.withBuildType(instance.getBuildType()); 
            this.withRemote(instance.getRemote()); 
            this.withProvides(instance.getProvides()); 
            this.withRequires(instance.getRequires()); 
            this.validationEnabled = validationEnabled; 
    }

    public EditableComponentConfig build(){
            EditableComponentConfig buildable = new EditableComponentConfig(fluent.getProject(),fluent.getAttributes(),fluent.getPartOf(),fluent.getName(),fluent.getVersion(),fluent.getDeploymentMode(),fluent.isExposeService(),fluent.getEnvs(),fluent.getLabels(),fluent.getBuildType(),fluent.getRemote(),fluent.getProvides(),fluent.getRequires());
            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;
            ComponentConfigBuilder that = (ComponentConfigBuilder) 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 - 2025 Weber Informatics LLC | Privacy Policy