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

io.dekorate.halkyon.model.RequiredComponentCapabilityBuilder 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 RequiredComponentCapabilityBuilder extends RequiredComponentCapabilityFluentImpl implements VisitableBuilder {

    RequiredComponentCapabilityFluent fluent;
    Boolean validationEnabled;

    public RequiredComponentCapabilityBuilder() { 
        this(true);
    }


    public RequiredComponentCapabilityBuilder(Boolean validationEnabled) { 
        this(new RequiredComponentCapability(), validationEnabled);
    }


    public RequiredComponentCapabilityBuilder(RequiredComponentCapabilityFluent fluent) { 
        this(fluent, true);
    }


    public RequiredComponentCapabilityBuilder(RequiredComponentCapabilityFluent fluent,Boolean validationEnabled) { 
        this(fluent, new RequiredComponentCapability(), validationEnabled);
    }


    public RequiredComponentCapabilityBuilder(RequiredComponentCapabilityFluent fluent,RequiredComponentCapability instance) { 
        this(fluent, instance, true);
    }


    public RequiredComponentCapabilityBuilder(RequiredComponentCapabilityFluent fluent,RequiredComponentCapability instance,Boolean validationEnabled) { 
        this.fluent = fluent; 
        fluent.withName(instance.getName()); 
        fluent.withSpec(instance.getSpec()); 
        fluent.withParameters(instance.getParameters()); 
        fluent.withBoundTo(instance.getBoundTo()); 
        fluent.withAutoBindable(instance.isAutoBindable()); 
        this.validationEnabled = validationEnabled; 
    }


    public RequiredComponentCapabilityBuilder(RequiredComponentCapability instance) { 
        this(instance,true);
    }


    public RequiredComponentCapabilityBuilder(RequiredComponentCapability instance,Boolean validationEnabled) { 
        this.fluent = this; 
        this.withName(instance.getName()); 
        this.withSpec(instance.getSpec()); 
        this.withParameters(instance.getParameters()); 
        this.withBoundTo(instance.getBoundTo()); 
        this.withAutoBindable(instance.isAutoBindable()); 
        this.validationEnabled = validationEnabled; 
    }


    public RequiredComponentCapability build() {
        RequiredComponentCapability buildable = new RequiredComponentCapability(fluent.getName(),fluent.getSpec(),fluent.getParameters(),fluent.getBoundTo(),fluent.isAutoBindable());
        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;
        RequiredComponentCapabilityBuilder that = (RequiredComponentCapabilityBuilder) 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