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

io.dekorate.halkyon.model.ComponentCapabilityBuilder Maven / Gradle / Ivy

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

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

public class ComponentCapabilityBuilder extends ComponentCapabilityFluentImpl implements VisitableBuilder {

    ComponentCapabilityFluent fluent;
    Boolean validationEnabled;

    public ComponentCapabilityBuilder() { 
        this(true);
    }


    public ComponentCapabilityBuilder(Boolean validationEnabled) { 
        this(new ComponentCapability(), validationEnabled);
    }


    public ComponentCapabilityBuilder(ComponentCapabilityFluent fluent) { 
        this(fluent, true);
    }


    public ComponentCapabilityBuilder(ComponentCapabilityFluent fluent,Boolean validationEnabled) { 
        this(fluent, new ComponentCapability(), validationEnabled);
    }


    public ComponentCapabilityBuilder(ComponentCapabilityFluent fluent,ComponentCapability instance) { 
        this(fluent, instance, true);
    }


    public ComponentCapabilityBuilder(ComponentCapabilityFluent fluent,ComponentCapability instance,Boolean validationEnabled) { 
        this.fluent = fluent; 
        fluent.withName(instance.getName()); 
        fluent.withSpec(instance.getSpec()); 
        fluent.withParameters(instance.getParameters()); 
        this.validationEnabled = validationEnabled; 
    }


    public ComponentCapabilityBuilder(ComponentCapability instance) { 
        this(instance,true);
    }


    public ComponentCapabilityBuilder(ComponentCapability instance,Boolean validationEnabled) { 
        this.fluent = this; 
        this.withName(instance.getName()); 
        this.withSpec(instance.getSpec()); 
        this.withParameters(instance.getParameters()); 
        this.validationEnabled = validationEnabled; 
    }


    public ComponentCapability build() {
        ComponentCapability buildable = new ComponentCapability(fluent.getName(),fluent.getSpec(),fluent.getParameters());
        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;
        ComponentCapabilityBuilder that = (ComponentCapabilityBuilder) 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;
    }

    public int hashCode() {
        return java.util.Objects.hash(fluent,  validationEnabled,  super.hashCode());
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy