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

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

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

import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.fabric8.kubernetes.api.builder.Nested;
import java.lang.String;
import java.lang.Deprecated;
import javax.validation.Valid;
import io.fabric8.kubernetes.api.builder.BaseFluent;
import java.lang.Object;
import java.lang.Boolean;

public class RandomSamplingFluentImpl> extends io.fabric8.kubernetes.api.builder.BaseFluent implements RandomSamplingFluent{

    private String attributeExpression;
    private FractionalPercentBuilder percentSampled;
    private Boolean useIndependentRandomness;

    public RandomSamplingFluentImpl(){
    }
    public RandomSamplingFluentImpl(RandomSampling instance){
            this.withAttributeExpression(instance.getAttributeExpression()); 
            this.withPercentSampled(instance.getPercentSampled()); 
            this.withUseIndependentRandomness(instance.getUseIndependentRandomness()); 
    }

    public String getAttributeExpression(){
            return this.attributeExpression;
    }

    public A withAttributeExpression(String attributeExpression){
            this.attributeExpression=attributeExpression; return (A) this;
    }

    public Boolean hasAttributeExpression(){
            return this.attributeExpression != null;
    }

    
/**
 * This method has been deprecated, please use method buildPercentSampled instead.
 * @return The buildable object.
 */
@Deprecated public FractionalPercent getPercentSampled(){
            return this.percentSampled!=null?this.percentSampled.build():null;
    }

    public FractionalPercent buildPercentSampled(){
            return this.percentSampled!=null?this.percentSampled.build():null;
    }

    public A withPercentSampled(FractionalPercent percentSampled){
            _visitables.remove(this.percentSampled);
            if (percentSampled!=null){ this.percentSampled= new FractionalPercentBuilder(percentSampled); _visitables.add(this.percentSampled);} return (A) this;
    }

    public Boolean hasPercentSampled(){
            return this.percentSampled != null;
    }

    public RandomSamplingFluent.PercentSampledNested withNewPercentSampled(){
            return new PercentSampledNestedImpl();
    }

    public RandomSamplingFluent.PercentSampledNested withNewPercentSampledLike(FractionalPercent item){
            return new PercentSampledNestedImpl(item);
    }

    public RandomSamplingFluent.PercentSampledNested editPercentSampled(){
            return withNewPercentSampledLike(getPercentSampled());
    }

    public RandomSamplingFluent.PercentSampledNested editOrNewPercentSampled(){
            return withNewPercentSampledLike(getPercentSampled() != null ? getPercentSampled(): new FractionalPercentBuilder().build());
    }

    public RandomSamplingFluent.PercentSampledNested editOrNewPercentSampledLike(FractionalPercent item){
            return withNewPercentSampledLike(getPercentSampled() != null ? getPercentSampled(): item);
    }

    public Boolean isUseIndependentRandomness(){
            return this.useIndependentRandomness;
    }

    public A withUseIndependentRandomness(Boolean useIndependentRandomness){
            this.useIndependentRandomness=useIndependentRandomness; return (A) this;
    }

    public Boolean hasUseIndependentRandomness(){
            return this.useIndependentRandomness != null;
    }

    public A withNewUseIndependentRandomness(String arg1){
            return (A)withUseIndependentRandomness(new Boolean(arg1));
    }

    public A withNewUseIndependentRandomness(boolean arg1){
            return (A)withUseIndependentRandomness(new Boolean(arg1));
    }

    public boolean equals(Object o){
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            if (!super.equals(o)) return false;
            RandomSamplingFluentImpl that = (RandomSamplingFluentImpl) o;
            if (attributeExpression != null ? !attributeExpression.equals(that.attributeExpression) :that.attributeExpression != null) return false;
            if (percentSampled != null ? !percentSampled.equals(that.percentSampled) :that.percentSampled != null) return false;
            if (useIndependentRandomness != null ? !useIndependentRandomness.equals(that.useIndependentRandomness) :that.useIndependentRandomness != null) return false;
            return true;
    }


    public class PercentSampledNestedImpl extends FractionalPercentFluentImpl> implements RandomSamplingFluent.PercentSampledNested,io.fabric8.kubernetes.api.builder.Nested{

            private final FractionalPercentBuilder builder;
    
            PercentSampledNestedImpl(FractionalPercent item){
                    this.builder = new FractionalPercentBuilder(this, item);
            }
            PercentSampledNestedImpl(){
                    this.builder = new FractionalPercentBuilder(this);
            }
    
    public N and(){
            return (N) RandomSamplingFluentImpl.this.withPercentSampled(builder.build());
    }
    public N endPercentSampled(){
            return and();
    }

}


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy