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

me.snowdrop.istio.api.model.v1.routing.ThrottleBuilder Maven / Gradle / Ivy

package me.snowdrop.istio.api.model.v1.routing;

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

public class ThrottleBuilder extends ThrottleFluentImpl implements VisitableBuilder{

    ThrottleFluent fluent;
    Boolean validationEnabled;

    public ThrottleBuilder(){
            this(true);
    }
    public ThrottleBuilder(Boolean validationEnabled){
            this(new Throttle(), validationEnabled);
    }
    public ThrottleBuilder(ThrottleFluent fluent){
            this(fluent, true);
    }
    public ThrottleBuilder(ThrottleFluent fluent,Boolean validationEnabled){
            this(fluent, new Throttle(), validationEnabled);
    }
    public ThrottleBuilder(ThrottleFluent fluent,Throttle instance){
            this(fluent, instance, true);
    }
    public ThrottleBuilder(ThrottleFluent fluent,Throttle instance,Boolean validationEnabled){
            this.fluent = fluent; 
            fluent.withThrottleAfter(instance.getThrottleAfter()); 
            fluent.withDownstreamLimitBps(instance.getDownstreamLimitBps()); 
            fluent.withPercent(instance.getPercent()); 
            fluent.withThrottleForPeriod(instance.getThrottleForPeriod()); 
            fluent.withUpstreamLimitBps(instance.getUpstreamLimitBps()); 
            this.validationEnabled = validationEnabled; 
    }
    public ThrottleBuilder(Throttle instance){
            this(instance,true);
    }
    public ThrottleBuilder(Throttle instance,Boolean validationEnabled){
            this.fluent = this; 
            this.withThrottleAfter(instance.getThrottleAfter()); 
            this.withDownstreamLimitBps(instance.getDownstreamLimitBps()); 
            this.withPercent(instance.getPercent()); 
            this.withThrottleForPeriod(instance.getThrottleForPeriod()); 
            this.withUpstreamLimitBps(instance.getUpstreamLimitBps()); 
            this.validationEnabled = validationEnabled; 
    }

    public Throttle build(){
            Throttle buildable = new Throttle(fluent.getThrottleAfter(),fluent.getDownstreamLimitBps(),fluent.getPercent(),fluent.getThrottleForPeriod(),fluent.getUpstreamLimitBps());
            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;
            ThrottleBuilder that = (ThrottleBuilder) 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