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

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

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

import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.lang.String;
import java.util.LinkedHashMap;
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 MatchRequestFluentImpl> extends me.snowdrop.istio.api.builder.BaseFluent implements MatchRequestFluent{

    private Map headers;

    public MatchRequestFluentImpl(){
    }
    public MatchRequestFluentImpl(MatchRequest instance){
            this.withHeaders(instance.getHeaders()); 
    }

    public A addToHeaders(String key,StringMatch value){
            if(key != null && value != null) {this.headers.put(key, value);} return (A)this;
    }

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

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

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

    public Map getHeaders(){
            return this.headers;
    }

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

    public Boolean hasHeaders(){
            return this.headers != 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;
            MatchRequestFluentImpl that = (MatchRequestFluentImpl) o;
            if (headers != null ? !headers.equals(that.headers) :that.headers != null) return false;
            return true;
    }




}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy