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

me.snowdrop.istio.api.networking.v1alpha3.PercentBuilder Maven / Gradle / Ivy

package me.snowdrop.istio.api.networking.v1alpha3;

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

public class PercentBuilder extends PercentFluentImpl implements VisitableBuilder{

    PercentFluent fluent;
    Boolean validationEnabled;
    Validator validator;

    public PercentBuilder(){
            this(true);
    }
    public PercentBuilder(Boolean validationEnabled){
            this(new Percent(), validationEnabled);
    }
    public PercentBuilder(PercentFluent fluent){
            this(fluent, true);
    }
    public PercentBuilder(PercentFluent fluent,Boolean validationEnabled){
            this(fluent, new Percent(), validationEnabled);
    }
    public PercentBuilder(PercentFluent fluent,Percent instance){
            this(fluent, instance, true);
    }
    public PercentBuilder(PercentFluent fluent,Percent instance,Boolean validationEnabled){
            this.fluent = fluent; 
            fluent.withValue(instance.getValue()); 
            this.validationEnabled = validationEnabled; 
    }
    public PercentBuilder(Percent instance){
            this(instance,true);
    }
    public PercentBuilder(Percent instance,Boolean validationEnabled){
            this.fluent = this; 
            this.withValue(instance.getValue()); 
            this.validationEnabled = validationEnabled; 
    }
    public PercentBuilder(Validator validator){
            this(new Percent(), true);
    }
    public PercentBuilder(PercentFluent fluent,Percent instance,Validator validator){
            this.fluent = fluent; 
            fluent.withValue(instance.getValue()); 
            this.validator = validator;
            this.validationEnabled = validator != null; 
    }
    public PercentBuilder(Percent instance,Validator validator){
            this.fluent = this; 
            this.withValue(instance.getValue()); 
            this.validator = validator; 
            this.validationEnabled = validator != null; 
    }

    public Percent build(){
            Percent buildable = new Percent(fluent.getValue());
            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;
            PercentBuilder that = (PercentBuilder) 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