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

me.snowdrop.istio.api.mesh.v1alpha1.FailoverBuilder Maven / Gradle / Ivy

package me.snowdrop.istio.api.mesh.v1alpha1;

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

public class FailoverBuilder extends FailoverFluentImpl implements VisitableBuilder{

    FailoverFluent fluent;
    Boolean validationEnabled;
    Validator validator;

    public FailoverBuilder(){
            this(true);
    }
    public FailoverBuilder(Boolean validationEnabled){
            this(new Failover(), validationEnabled);
    }
    public FailoverBuilder(FailoverFluent fluent){
            this(fluent, true);
    }
    public FailoverBuilder(FailoverFluent fluent,Boolean validationEnabled){
            this(fluent, new Failover(), validationEnabled);
    }
    public FailoverBuilder(FailoverFluent fluent,Failover instance){
            this(fluent, instance, true);
    }
    public FailoverBuilder(FailoverFluent fluent,Failover instance,Boolean validationEnabled){
            this.fluent = fluent; 
            fluent.withFrom(instance.getFrom()); 
            fluent.withTo(instance.getTo()); 
            this.validationEnabled = validationEnabled; 
    }
    public FailoverBuilder(Failover instance){
            this(instance,true);
    }
    public FailoverBuilder(Failover instance,Boolean validationEnabled){
            this.fluent = this; 
            this.withFrom(instance.getFrom()); 
            this.withTo(instance.getTo()); 
            this.validationEnabled = validationEnabled; 
    }
    public FailoverBuilder(Validator validator){
            this(new Failover(), true);
    }
    public FailoverBuilder(FailoverFluent fluent,Failover instance,Validator validator){
            this.fluent = fluent; 
            fluent.withFrom(instance.getFrom()); 
            fluent.withTo(instance.getTo()); 
            this.validator = validator;
            this.validationEnabled = validator != null; 
    }
    public FailoverBuilder(Failover instance,Validator validator){
            this.fluent = this; 
            this.withFrom(instance.getFrom()); 
            this.withTo(instance.getTo()); 
            this.validator = validator; 
            this.validationEnabled = validator != null; 
    }

    public Failover build(){
            Failover buildable = new Failover(fluent.getFrom(),fluent.getTo());
            if (validationEnabled) {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;
            FailoverBuilder that = (FailoverBuilder) 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