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

me.snowdrop.istio.api.policy.v1beta1.RandomSamplingBuilder Maven / Gradle / Ivy

package me.snowdrop.istio.api.policy.v1beta1;

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

public class RandomSamplingBuilder extends RandomSamplingFluentImpl implements VisitableBuilder{

    RandomSamplingFluent fluent;
    Boolean validationEnabled;
    Validator validator;

    public RandomSamplingBuilder(){
            this(true);
    }
    public RandomSamplingBuilder(Boolean validationEnabled){
            this(new RandomSampling(), validationEnabled);
    }
    public RandomSamplingBuilder(RandomSamplingFluent fluent){
            this(fluent, true);
    }
    public RandomSamplingBuilder(RandomSamplingFluent fluent,Boolean validationEnabled){
            this(fluent, new RandomSampling(), validationEnabled);
    }
    public RandomSamplingBuilder(RandomSamplingFluent fluent,RandomSampling instance){
            this(fluent, instance, true);
    }
    public RandomSamplingBuilder(RandomSamplingFluent fluent,RandomSampling instance,Boolean validationEnabled){
            this.fluent = fluent; 
            fluent.withAttributeExpression(instance.getAttributeExpression()); 
            fluent.withPercentSampled(instance.getPercentSampled()); 
            fluent.withUseIndependentRandomness(instance.getUseIndependentRandomness()); 
            this.validationEnabled = validationEnabled; 
    }
    public RandomSamplingBuilder(RandomSampling instance){
            this(instance,true);
    }
    public RandomSamplingBuilder(RandomSampling instance,Boolean validationEnabled){
            this.fluent = this; 
            this.withAttributeExpression(instance.getAttributeExpression()); 
            this.withPercentSampled(instance.getPercentSampled()); 
            this.withUseIndependentRandomness(instance.getUseIndependentRandomness()); 
            this.validationEnabled = validationEnabled; 
    }
    public RandomSamplingBuilder(Validator validator){
            this(new RandomSampling(), true);
    }
    public RandomSamplingBuilder(RandomSamplingFluent fluent,RandomSampling instance,Validator validator){
            this.fluent = fluent; 
            fluent.withAttributeExpression(instance.getAttributeExpression()); 
            fluent.withPercentSampled(instance.getPercentSampled()); 
            fluent.withUseIndependentRandomness(instance.getUseIndependentRandomness()); 
            this.validator = validator;
            this.validationEnabled = validator != null; 
    }
    public RandomSamplingBuilder(RandomSampling instance,Validator validator){
            this.fluent = this; 
            this.withAttributeExpression(instance.getAttributeExpression()); 
            this.withPercentSampled(instance.getPercentSampled()); 
            this.withUseIndependentRandomness(instance.getUseIndependentRandomness()); 
            this.validator = validator; 
            this.validationEnabled = validator != null; 
    }

    public RandomSampling build(){
            RandomSampling buildable = new RandomSampling(fluent.getAttributeExpression(),fluent.getPercentSampled(),fluent.isUseIndependentRandomness());
            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;
            RandomSamplingBuilder that = (RandomSamplingBuilder) 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