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

io.strimzi.api.kafka.model.KafkaUserSpecBuilder Maven / Gradle / Ivy

There is a newer version: 0.45.0
Show newest version
package io.strimzi.api.kafka.model;

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

public class KafkaUserSpecBuilder extends KafkaUserSpecFluentImpl implements VisitableBuilder{

    KafkaUserSpecFluent fluent;
    Boolean validationEnabled;

    public KafkaUserSpecBuilder(){
            this(true);
    }
    public KafkaUserSpecBuilder(Boolean validationEnabled){
            this(new KafkaUserSpec(), validationEnabled);
    }
    public KafkaUserSpecBuilder(KafkaUserSpecFluent fluent){
            this(fluent, true);
    }
    public KafkaUserSpecBuilder(KafkaUserSpecFluent fluent,Boolean validationEnabled){
            this(fluent, new KafkaUserSpec(), validationEnabled);
    }
    public KafkaUserSpecBuilder(KafkaUserSpecFluent fluent,KafkaUserSpec instance){
            this(fluent, instance, true);
    }
    public KafkaUserSpecBuilder(KafkaUserSpecFluent fluent,KafkaUserSpec instance,Boolean validationEnabled){
            this.fluent = fluent; 
            fluent.withAuthentication(instance.getAuthentication());

            fluent.withAuthorization(instance.getAuthorization());

            fluent.withQuotas(instance.getQuotas());

            this.validationEnabled = validationEnabled; 
    }
    public KafkaUserSpecBuilder(KafkaUserSpec instance){
            this(instance,true);
    }
    public KafkaUserSpecBuilder(KafkaUserSpec instance,Boolean validationEnabled){
            this.fluent = this; 
            this.withAuthentication(instance.getAuthentication());

            this.withAuthorization(instance.getAuthorization());

            this.withQuotas(instance.getQuotas());

            this.validationEnabled = validationEnabled; 
    }

    public KafkaUserSpec build(){
            KafkaUserSpec buildable = new KafkaUserSpec();
            buildable.setAuthentication(fluent.getAuthentication());
            buildable.setAuthorization(fluent.getAuthorization());
            buildable.setQuotas(fluent.getQuotas());
            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;
            KafkaUserSpecBuilder that = (KafkaUserSpecBuilder) 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