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

me.snowdrop.istio.api.model.v1.routing.IstioServiceBuilder Maven / Gradle / Ivy

package me.snowdrop.istio.api.model.v1.routing;

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

public class IstioServiceBuilder extends IstioServiceFluentImpl implements VisitableBuilder{

    IstioServiceFluent fluent;
    Boolean validationEnabled;

    public IstioServiceBuilder(){
            this(true);
    }
    public IstioServiceBuilder(Boolean validationEnabled){
            this(new IstioService(), validationEnabled);
    }
    public IstioServiceBuilder(IstioServiceFluent fluent){
            this(fluent, true);
    }
    public IstioServiceBuilder(IstioServiceFluent fluent,Boolean validationEnabled){
            this(fluent, new IstioService(), validationEnabled);
    }
    public IstioServiceBuilder(IstioServiceFluent fluent,IstioService instance){
            this(fluent, instance, true);
    }
    public IstioServiceBuilder(IstioServiceFluent fluent,IstioService instance,Boolean validationEnabled){
            this.fluent = fluent; 
            fluent.withDomain(instance.getDomain()); 
            fluent.withLabels(instance.getLabels()); 
            fluent.withName(instance.getName()); 
            fluent.withNamespace(instance.getNamespace()); 
            fluent.withService(instance.getService()); 
            this.validationEnabled = validationEnabled; 
    }
    public IstioServiceBuilder(IstioService instance){
            this(instance,true);
    }
    public IstioServiceBuilder(IstioService instance,Boolean validationEnabled){
            this.fluent = this; 
            this.withDomain(instance.getDomain()); 
            this.withLabels(instance.getLabels()); 
            this.withName(instance.getName()); 
            this.withNamespace(instance.getNamespace()); 
            this.withService(instance.getService()); 
            this.validationEnabled = validationEnabled; 
    }

    public IstioService build(){
            IstioService buildable = new IstioService(fluent.getDomain(),fluent.getLabels(),fluent.getName(),fluent.getNamespace(),fluent.getService());
            io.fabric8.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;
            IstioServiceBuilder that = (IstioServiceBuilder) 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