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

me.snowdrop.istio.api.policy.v1beta1.SamplingFluentImpl 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.Integer;
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 SamplingFluentImpl> extends io.fabric8.kubernetes.api.builder.BaseFluent implements SamplingFluent{

    private RandomSamplingBuilder random;
    private RateLimitSamplingBuilder rateLimit;

    public SamplingFluentImpl(){
    }
    public SamplingFluentImpl(Sampling instance){
            this.withRandom(instance.getRandom()); 
            this.withRateLimit(instance.getRateLimit()); 
    }

    
/**
 * This method has been deprecated, please use method buildRandom instead.
 * @return The buildable object.
 */
@Deprecated public RandomSampling getRandom(){
            return this.random!=null?this.random.build():null;
    }

    public RandomSampling buildRandom(){
            return this.random!=null?this.random.build():null;
    }

    public A withRandom(RandomSampling random){
            _visitables.remove(this.random);
            if (random!=null){ this.random= new RandomSamplingBuilder(random); _visitables.add(this.random);} return (A) this;
    }

    public Boolean hasRandom(){
            return this.random != null;
    }

    public SamplingFluent.RandomNested withNewRandom(){
            return new RandomNestedImpl();
    }

    public SamplingFluent.RandomNested withNewRandomLike(RandomSampling item){
            return new RandomNestedImpl(item);
    }

    public SamplingFluent.RandomNested editRandom(){
            return withNewRandomLike(getRandom());
    }

    public SamplingFluent.RandomNested editOrNewRandom(){
            return withNewRandomLike(getRandom() != null ? getRandom(): new RandomSamplingBuilder().build());
    }

    public SamplingFluent.RandomNested editOrNewRandomLike(RandomSampling item){
            return withNewRandomLike(getRandom() != null ? getRandom(): item);
    }

    
/**
 * This method has been deprecated, please use method buildRateLimit instead.
 * @return The buildable object.
 */
@Deprecated public RateLimitSampling getRateLimit(){
            return this.rateLimit!=null?this.rateLimit.build():null;
    }

    public RateLimitSampling buildRateLimit(){
            return this.rateLimit!=null?this.rateLimit.build():null;
    }

    public A withRateLimit(RateLimitSampling rateLimit){
            _visitables.remove(this.rateLimit);
            if (rateLimit!=null){ this.rateLimit= new RateLimitSamplingBuilder(rateLimit); _visitables.add(this.rateLimit);} return (A) this;
    }

    public Boolean hasRateLimit(){
            return this.rateLimit != null;
    }

    public A withNewRateLimit(Integer maxUnsampledEntries,Integer samplingDuration,Integer samplingRate){
            return (A)withRateLimit(new RateLimitSampling(maxUnsampledEntries, samplingDuration, samplingRate));
    }

    public SamplingFluent.RateLimitNested withNewRateLimit(){
            return new RateLimitNestedImpl();
    }

    public SamplingFluent.RateLimitNested withNewRateLimitLike(RateLimitSampling item){
            return new RateLimitNestedImpl(item);
    }

    public SamplingFluent.RateLimitNested editRateLimit(){
            return withNewRateLimitLike(getRateLimit());
    }

    public SamplingFluent.RateLimitNested editOrNewRateLimit(){
            return withNewRateLimitLike(getRateLimit() != null ? getRateLimit(): new RateLimitSamplingBuilder().build());
    }

    public SamplingFluent.RateLimitNested editOrNewRateLimitLike(RateLimitSampling item){
            return withNewRateLimitLike(getRateLimit() != null ? getRateLimit(): item);
    }

    public boolean equals(Object o){
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            if (!super.equals(o)) return false;
            SamplingFluentImpl that = (SamplingFluentImpl) o;
            if (random != null ? !random.equals(that.random) :that.random != null) return false;
            if (rateLimit != null ? !rateLimit.equals(that.rateLimit) :that.rateLimit != null) return false;
            return true;
    }


    public class RandomNestedImpl extends RandomSamplingFluentImpl> implements SamplingFluent.RandomNested,io.fabric8.kubernetes.api.builder.Nested{

            private final RandomSamplingBuilder builder;
    
            RandomNestedImpl(RandomSampling item){
                    this.builder = new RandomSamplingBuilder(this, item);
            }
            RandomNestedImpl(){
                    this.builder = new RandomSamplingBuilder(this);
            }
    
    public N and(){
            return (N) SamplingFluentImpl.this.withRandom(builder.build());
    }
    public N endRandom(){
            return and();
    }

}
    public class RateLimitNestedImpl extends RateLimitSamplingFluentImpl> implements SamplingFluent.RateLimitNested,io.fabric8.kubernetes.api.builder.Nested{

            private final RateLimitSamplingBuilder builder;
    
            RateLimitNestedImpl(RateLimitSampling item){
                    this.builder = new RateLimitSamplingBuilder(this, item);
            }
            RateLimitNestedImpl(){
                    this.builder = new RateLimitSamplingBuilder(this);
            }
    
    public N and(){
            return (N) SamplingFluentImpl.this.withRateLimit(builder.build());
    }
    public N endRateLimit(){
            return and();
    }

}


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy