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

me.snowdrop.istio.mixer.adapter.prometheus.LinearBuilder Maven / Gradle / Ivy

The newest version!
package me.snowdrop.istio.mixer.adapter.prometheus;

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

public class LinearBuilder extends LinearFluentImpl implements VisitableBuilder{

    LinearFluent fluent;
    Boolean validationEnabled;

    public LinearBuilder(){
            this(true);
    }
    public LinearBuilder(Boolean validationEnabled){
            this(new Linear(), validationEnabled);
    }
    public LinearBuilder(LinearFluent fluent){
            this(fluent, true);
    }
    public LinearBuilder(LinearFluent fluent,Boolean validationEnabled){
            this(fluent, new Linear(), validationEnabled);
    }
    public LinearBuilder(LinearFluent fluent,Linear instance){
            this(fluent, instance, true);
    }
    public LinearBuilder(LinearFluent fluent,Linear instance,Boolean validationEnabled){
            this.fluent = fluent; 
            fluent.withNumFiniteBuckets(instance.getNumFiniteBuckets()); 
            fluent.withOffset(instance.getOffset()); 
            fluent.withWidth(instance.getWidth()); 
            this.validationEnabled = validationEnabled; 
    }
    public LinearBuilder(Linear instance){
            this(instance,true);
    }
    public LinearBuilder(Linear instance,Boolean validationEnabled){
            this.fluent = this; 
            this.withNumFiniteBuckets(instance.getNumFiniteBuckets()); 
            this.withOffset(instance.getOffset()); 
            this.withWidth(instance.getWidth()); 
            this.validationEnabled = validationEnabled; 
    }

    public Linear build(){
            Linear buildable = new Linear(fluent.getNumFiniteBuckets(),fluent.getOffset(),fluent.getWidth());
            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;
            LinearBuilder that = (LinearBuilder) 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 - 2024 Weber Informatics LLC | Privacy Policy