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

me.snowdrop.istio.api.model.v1.mixer.CheckResponseFluentImpl Maven / Gradle / Ivy

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

import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonProperty;
import me.snowdrop.istio.api.builder.Nested;
import java.lang.String;
import java.util.LinkedHashMap;
import java.lang.Deprecated;
import javax.validation.Valid;
import me.snowdrop.istio.api.builder.BaseFluent;
import java.lang.Object;
import java.lang.Boolean;
import java.util.Map;

public class CheckResponseFluentImpl> extends me.snowdrop.istio.api.builder.BaseFluent implements CheckResponseFluent{

    private PreconditionResultBuilder precondition;
    private Map quotas;

    public CheckResponseFluentImpl(){
    }
    public CheckResponseFluentImpl(CheckResponse instance){
            this.withPrecondition(instance.getPrecondition()); 
            this.withQuotas(instance.getQuotas()); 
    }

    
/**
 * This method has been deprecated, please use method buildPrecondition instead.
 */
@Deprecated public PreconditionResult getPrecondition(){
            return this.precondition!=null?this.precondition.build():null;
    }

    public PreconditionResult buildPrecondition(){
            return this.precondition!=null?this.precondition.build():null;
    }

    public A withPrecondition(PreconditionResult precondition){
            _visitables.remove(this.precondition);
            if (precondition!=null){ this.precondition= new PreconditionResultBuilder(precondition); _visitables.add(this.precondition);} return (A) this;
    }

    public Boolean hasPrecondition(){
            return this.precondition != null;
    }

    public CheckResponseFluent.PreconditionNested withNewPrecondition(){
            return new PreconditionNestedImpl();
    }

    public CheckResponseFluent.PreconditionNested withNewPreconditionLike(PreconditionResult item){
            return new PreconditionNestedImpl(item);
    }

    public CheckResponseFluent.PreconditionNested editPrecondition(){
            return withNewPreconditionLike(getPrecondition());
    }

    public CheckResponseFluent.PreconditionNested editOrNewPrecondition(){
            return withNewPreconditionLike(getPrecondition() != null ? getPrecondition(): new PreconditionResultBuilder().build());
    }

    public CheckResponseFluent.PreconditionNested editOrNewPreconditionLike(PreconditionResult item){
            return withNewPreconditionLike(getPrecondition() != null ? getPrecondition(): item);
    }

    public A addToQuotas(String key,QuotaResult value){
            if(key != null && value != null) {this.quotas.put(key, value);} return (A)this;
    }

    public A addToQuotas(Map map){
            if(map != null) { this.quotas.putAll(map);} return (A)this;
    }

    public A removeFromQuotas(String key){
            if(key != null && this.quotas != null) {this.quotas.remove(key);} return (A)this;
    }

    public A removeFromQuotas(Map map){
            if(map != null) { for(Object key : map.keySet()) {if (this.quotas != null){this.quotas.remove(key);}}} return (A)this;
    }

    public Map getQuotas(){
            return this.quotas;
    }

    public A withQuotas(Map quotas){
            if (this.quotas == null) { this.quotas = new LinkedHashMap();} else {this.quotas.clear();}
            if (quotas != null) {this.quotas.putAll(quotas);} return (A) this;
    }

    public Boolean hasQuotas(){
            return this.quotas != null;
    }

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


    public class PreconditionNestedImpl extends PreconditionResultFluentImpl> implements CheckResponseFluent.PreconditionNested,me.snowdrop.istio.api.builder.Nested{

            private final PreconditionResultBuilder builder;
    
            PreconditionNestedImpl(PreconditionResult item){
                    this.builder = new PreconditionResultBuilder(this, item);
            }
            PreconditionNestedImpl(){
                    this.builder = new PreconditionResultBuilder(this);
            }
    
    public N and(){
            return (N) CheckResponseFluentImpl.this.withPrecondition(builder.build());
    }
    public N endPrecondition(){
            return and();
    }

}


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy