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

me.snowdrop.istio.api.model.v1.networking.HTTPMatchRequestFluentImpl Maven / Gradle / Ivy

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

import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.fabric8.kubernetes.api.builder.Nested;
import java.util.ArrayList;
import java.lang.String;
import io.fabric8.kubernetes.api.builder.Predicate;
import java.util.LinkedHashMap;
import java.lang.Deprecated;
import io.fabric8.kubernetes.api.builder.BaseFluent;
import java.util.List;
import java.lang.Boolean;
import java.lang.Integer;
import javax.validation.Valid;
import java.util.Collection;
import java.lang.Object;
import java.util.Map;

public class HTTPMatchRequestFluentImpl> extends io.fabric8.kubernetes.api.builder.BaseFluent implements HTTPMatchRequestFluent{

    private StringMatchBuilder authority;
    private List gateways;
    private Map headers;
    private StringMatchBuilder method;
    private Integer port;
    private StringMatchBuilder scheme;
    private Map sourceLabels;
    private StringMatchBuilder uri;

    public HTTPMatchRequestFluentImpl(){
    }
    public HTTPMatchRequestFluentImpl(HTTPMatchRequest instance){
            this.withAuthority(instance.getAuthority()); 
            this.withGateways(instance.getGateways()); 
            this.withHeaders(instance.getHeaders()); 
            this.withMethod(instance.getMethod()); 
            this.withPort(instance.getPort()); 
            this.withScheme(instance.getScheme()); 
            this.withSourceLabels(instance.getSourceLabels()); 
            this.withUri(instance.getUri()); 
    }

    
/**
 * This method has been deprecated, please use method buildAuthority instead.
 */
@Deprecated public StringMatch getAuthority(){
            return this.authority!=null?this.authority.build():null;
    }

    public StringMatch buildAuthority(){
            return this.authority!=null?this.authority.build():null;
    }

    public A withAuthority(StringMatch authority){
            _visitables.remove(this.authority);
            if (authority!=null){ this.authority= new StringMatchBuilder(authority); _visitables.add(this.authority);} return (A) this;
    }

    public Boolean hasAuthority(){
            return this.authority != null;
    }

    public A withNewAuthority(Object matchType){
            return (A)withAuthority(new StringMatch(matchType));
    }

    public HTTPMatchRequestFluent.AuthorityNested withNewAuthority(){
            return new AuthorityNestedImpl();
    }

    public HTTPMatchRequestFluent.AuthorityNested withNewAuthorityLike(StringMatch item){
            return new AuthorityNestedImpl(item);
    }

    public HTTPMatchRequestFluent.AuthorityNested editAuthority(){
            return withNewAuthorityLike(getAuthority());
    }

    public HTTPMatchRequestFluent.AuthorityNested editOrNewAuthority(){
            return withNewAuthorityLike(getAuthority() != null ? getAuthority(): new StringMatchBuilder().build());
    }

    public HTTPMatchRequestFluent.AuthorityNested editOrNewAuthorityLike(StringMatch item){
            return withNewAuthorityLike(getAuthority() != null ? getAuthority(): item);
    }

    public A addToGateways(int index,String item){
            if (this.gateways == null) {this.gateways = new ArrayList();}
            this.gateways.add(index, item);
            return (A)this;
    }

    public A setToGateways(int index,String item){
            this.gateways.set(index, item); return (A)this;
    }

    public A addToGateways(String... items){
            for (String item : items) {this.gateways.add(item);} return (A)this;
    }

    public A addAllToGateways(Collection items){
            for (String item : items) {this.gateways.add(item);} return (A)this;
    }

    public A removeFromGateways(String... items){
            for (String item : items) {if (this.gateways!= null){ this.gateways.remove(item);}} return (A)this;
    }

    public A removeAllFromGateways(Collection items){
            for (String item : items) {if (this.gateways!= null){ this.gateways.remove(item);}} return (A)this;
    }

    public List getGateways(){
            return this.gateways;
    }

    public String getGateway(int index){
            return this.gateways.get(index);
    }

    public String getFirstGateway(){
            return this.gateways.get(0);
    }

    public String getLastGateway(){
            return this.gateways.get(gateways.size() - 1);
    }

    public String getMatchingGateway(io.fabric8.kubernetes.api.builder.Predicate predicate){
            for (String item: gateways) { if(predicate.apply(item)){return item;} } return null;
    }

    public A withGateways(List gateways){
            if (this.gateways != null) { _visitables.removeAll(this.gateways);}
            if (gateways != null) {this.gateways = new ArrayList(); for (String item : gateways){this.addToGateways(item);}} else { this.gateways = null;} return (A) this;
    }

    public A withGateways(String... gateways){
            this.gateways.clear(); if (gateways != null) {for (String item :gateways){ this.addToGateways(item);}} return (A) this;
    }

    public Boolean hasGateways(){
            return gateways != null && !gateways.isEmpty();
    }

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

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

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

    public A removeFromHeaders(Map map){
            if(this.headers == null) { return (A) this; }
            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 (headers == null) { this.headers =  null;} else {this.headers = new LinkedHashMap(headers);} return (A) this;
    }

    public Boolean hasHeaders(){
            return this.headers != null;
    }

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

    public StringMatch buildMethod(){
            return this.method!=null?this.method.build():null;
    }

    public A withMethod(StringMatch method){
            _visitables.remove(this.method);
            if (method!=null){ this.method= new StringMatchBuilder(method); _visitables.add(this.method);} return (A) this;
    }

    public Boolean hasMethod(){
            return this.method != null;
    }

    public A withNewMethod(Object matchType){
            return (A)withMethod(new StringMatch(matchType));
    }

    public HTTPMatchRequestFluent.MethodNested withNewMethod(){
            return new MethodNestedImpl();
    }

    public HTTPMatchRequestFluent.MethodNested withNewMethodLike(StringMatch item){
            return new MethodNestedImpl(item);
    }

    public HTTPMatchRequestFluent.MethodNested editMethod(){
            return withNewMethodLike(getMethod());
    }

    public HTTPMatchRequestFluent.MethodNested editOrNewMethod(){
            return withNewMethodLike(getMethod() != null ? getMethod(): new StringMatchBuilder().build());
    }

    public HTTPMatchRequestFluent.MethodNested editOrNewMethodLike(StringMatch item){
            return withNewMethodLike(getMethod() != null ? getMethod(): item);
    }

    public Integer getPort(){
            return this.port;
    }

    public A withPort(Integer port){
            this.port=port; return (A) this;
    }

    public Boolean hasPort(){
            return this.port != null;
    }

    public A withNewPort(int arg1){
            return (A)withPort(new Integer(arg1));
    }

    public A withNewPort(String arg1){
            return (A)withPort(new Integer(arg1));
    }

    
/**
 * This method has been deprecated, please use method buildScheme instead.
 */
@Deprecated public StringMatch getScheme(){
            return this.scheme!=null?this.scheme.build():null;
    }

    public StringMatch buildScheme(){
            return this.scheme!=null?this.scheme.build():null;
    }

    public A withScheme(StringMatch scheme){
            _visitables.remove(this.scheme);
            if (scheme!=null){ this.scheme= new StringMatchBuilder(scheme); _visitables.add(this.scheme);} return (A) this;
    }

    public Boolean hasScheme(){
            return this.scheme != null;
    }

    public A withNewScheme(Object matchType){
            return (A)withScheme(new StringMatch(matchType));
    }

    public HTTPMatchRequestFluent.SchemeNested withNewScheme(){
            return new SchemeNestedImpl();
    }

    public HTTPMatchRequestFluent.SchemeNested withNewSchemeLike(StringMatch item){
            return new SchemeNestedImpl(item);
    }

    public HTTPMatchRequestFluent.SchemeNested editScheme(){
            return withNewSchemeLike(getScheme());
    }

    public HTTPMatchRequestFluent.SchemeNested editOrNewScheme(){
            return withNewSchemeLike(getScheme() != null ? getScheme(): new StringMatchBuilder().build());
    }

    public HTTPMatchRequestFluent.SchemeNested editOrNewSchemeLike(StringMatch item){
            return withNewSchemeLike(getScheme() != null ? getScheme(): item);
    }

    public A addToSourceLabels(String key,String value){
            if(this.sourceLabels == null && key != null && value != null) { this.sourceLabels = new LinkedHashMap(); }
            if(key != null && value != null) {this.sourceLabels.put(key, value);} return (A)this;
    }

    public A addToSourceLabels(Map map){
            if(this.sourceLabels == null && map != null) { this.sourceLabels = new LinkedHashMap(); }
            if(map != null) { this.sourceLabels.putAll(map);} return (A)this;
    }

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

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

    public Map getSourceLabels(){
            return this.sourceLabels;
    }

    public A withSourceLabels(Map sourceLabels){
            if (sourceLabels == null) { this.sourceLabels =  null;} else {this.sourceLabels = new LinkedHashMap(sourceLabels);} return (A) this;
    }

    public Boolean hasSourceLabels(){
            return this.sourceLabels != null;
    }

    
/**
 * This method has been deprecated, please use method buildUri instead.
 */
@Deprecated public StringMatch getUri(){
            return this.uri!=null?this.uri.build():null;
    }

    public StringMatch buildUri(){
            return this.uri!=null?this.uri.build():null;
    }

    public A withUri(StringMatch uri){
            _visitables.remove(this.uri);
            if (uri!=null){ this.uri= new StringMatchBuilder(uri); _visitables.add(this.uri);} return (A) this;
    }

    public Boolean hasUri(){
            return this.uri != null;
    }

    public A withNewUri(Object matchType){
            return (A)withUri(new StringMatch(matchType));
    }

    public HTTPMatchRequestFluent.UriNested withNewUri(){
            return new UriNestedImpl();
    }

    public HTTPMatchRequestFluent.UriNested withNewUriLike(StringMatch item){
            return new UriNestedImpl(item);
    }

    public HTTPMatchRequestFluent.UriNested editUri(){
            return withNewUriLike(getUri());
    }

    public HTTPMatchRequestFluent.UriNested editOrNewUri(){
            return withNewUriLike(getUri() != null ? getUri(): new StringMatchBuilder().build());
    }

    public HTTPMatchRequestFluent.UriNested editOrNewUriLike(StringMatch item){
            return withNewUriLike(getUri() != null ? getUri(): item);
    }

    public boolean equals(Object o){
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            if (!super.equals(o)) return false;
            HTTPMatchRequestFluentImpl that = (HTTPMatchRequestFluentImpl) o;
            if (authority != null ? !authority.equals(that.authority) :that.authority != null) return false;
            if (gateways != null ? !gateways.equals(that.gateways) :that.gateways != null) return false;
            if (headers != null ? !headers.equals(that.headers) :that.headers != null) return false;
            if (method != null ? !method.equals(that.method) :that.method != null) return false;
            if (port != null ? !port.equals(that.port) :that.port != null) return false;
            if (scheme != null ? !scheme.equals(that.scheme) :that.scheme != null) return false;
            if (sourceLabels != null ? !sourceLabels.equals(that.sourceLabels) :that.sourceLabels != null) return false;
            if (uri != null ? !uri.equals(that.uri) :that.uri != null) return false;
            return true;
    }


    public class AuthorityNestedImpl extends StringMatchFluentImpl> implements HTTPMatchRequestFluent.AuthorityNested,io.fabric8.kubernetes.api.builder.Nested{

            private final StringMatchBuilder builder;
    
            AuthorityNestedImpl(StringMatch item){
                    this.builder = new StringMatchBuilder(this, item);
            }
            AuthorityNestedImpl(){
                    this.builder = new StringMatchBuilder(this);
            }
    
    public N and(){
            return (N) HTTPMatchRequestFluentImpl.this.withAuthority(builder.build());
    }
    public N endAuthority(){
            return and();
    }

}
    public class MethodNestedImpl extends StringMatchFluentImpl> implements HTTPMatchRequestFluent.MethodNested,io.fabric8.kubernetes.api.builder.Nested{

            private final StringMatchBuilder builder;
    
            MethodNestedImpl(StringMatch item){
                    this.builder = new StringMatchBuilder(this, item);
            }
            MethodNestedImpl(){
                    this.builder = new StringMatchBuilder(this);
            }
    
    public N and(){
            return (N) HTTPMatchRequestFluentImpl.this.withMethod(builder.build());
    }
    public N endMethod(){
            return and();
    }

}
    public class SchemeNestedImpl extends StringMatchFluentImpl> implements HTTPMatchRequestFluent.SchemeNested,io.fabric8.kubernetes.api.builder.Nested{

            private final StringMatchBuilder builder;
    
            SchemeNestedImpl(StringMatch item){
                    this.builder = new StringMatchBuilder(this, item);
            }
            SchemeNestedImpl(){
                    this.builder = new StringMatchBuilder(this);
            }
    
    public N and(){
            return (N) HTTPMatchRequestFluentImpl.this.withScheme(builder.build());
    }
    public N endScheme(){
            return and();
    }

}
    public class UriNestedImpl extends StringMatchFluentImpl> implements HTTPMatchRequestFluent.UriNested,io.fabric8.kubernetes.api.builder.Nested{

            private final StringMatchBuilder builder;
    
            UriNestedImpl(StringMatch item){
                    this.builder = new StringMatchBuilder(this, item);
            }
            UriNestedImpl(){
                    this.builder = new StringMatchBuilder(this);
            }
    
    public N and(){
            return (N) HTTPMatchRequestFluentImpl.this.withUri(builder.build());
    }
    public N endUri(){
            return and();
    }

}


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy