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

io.fabric8.kubernetes.api.model.extensions.IngressSpecFluentImpl Maven / Gradle / Ivy

There is a newer version: 6.13.4
Show newest version
package io.fabric8.kubernetes.api.model.extensions;

import java.util.ArrayList;
import java.util.RandomAccess;
import java.util.Map;
import java.util.List;
import java.util.Map;
import java.util.List;
import java.util.List;
import java.util.AbstractCollection;
import java.util.AbstractList;
import java.util.HashMap;
import java.io.Serializable;
import java.util.Collection;
import java.util.AbstractMap;
import io.fabric8.kubernetes.api.builder.Visitable;
import io.fabric8.kubernetes.api.builder.VisitableBuilder;
import io.fabric8.kubernetes.api.builder.BaseFluent;
import io.fabric8.kubernetes.api.builder.VisitableBuilder;
import io.fabric8.kubernetes.api.builder.Fluent;
import io.fabric8.kubernetes.api.builder.Nested;
import io.fabric8.kubernetes.api.builder.VisitableBuilder;
import io.fabric8.kubernetes.api.builder.Visitable;
import io.fabric8.kubernetes.api.builder.Builder;
import java.util.List;
import java.util.List;

public class IngressSpecFluentImpl> extends BaseFluent implements IngressSpecFluent{

     VisitableBuilder backend;     List> rules = new ArrayList();     List> tls = new ArrayList();     Map additionalProperties = new HashMap();
public IngressSpecFluentImpl(){
    
}
public IngressSpecFluentImpl( IngressSpec instance ){
    this.withBackend(instance.getBackend()); this.withRules(instance.getRules()); this.withTls(instance.getTls()); 
}

    public IngressBackend getBackend(){
    return this.backend!=null?this.backend.build():null;
    }
    public T withBackend( IngressBackend backend){
    if (backend!=null){ this.backend= new IngressBackendBuilder(backend); _visitables.add(this.backend);} return (T) this;
    }
    public BackendNested withNewBackend(){
    return new BackendNestedImpl();
    }
    public BackendNested withNewBackendLike( IngressBackend item){
    return new BackendNestedImpl(item);
    }
    public BackendNested editBackend(){
    return withNewBackendLike(getBackend());
    }
    public T addToRules( IngressRule ...items){
    for (IngressRule item : items) {IngressRuleBuilder builder = new IngressRuleBuilder(item);_visitables.add(builder);this.rules.add(builder);} return (T)this;
    }
    public T removeFromRules( IngressRule ...items){
    for (IngressRule item : items) {IngressRuleBuilder builder = new IngressRuleBuilder(item);_visitables.remove(builder);this.rules.remove(builder);} return (T)this;
    }
    public List getRules(){
    return build(rules);
    }
    public T withRules( List rules){
    this.rules.clear();if (rules != null) {for (IngressRule item : rules){this.addToRules(item);}} return (T) this;
    }
    public T withRules( IngressRule ...rules){
    this.rules.clear(); if (rules != null) {for (IngressRule item :rules){ this.addToRules(item);}} return (T) this;
    }
    public RulesNested addNewRule(){
    return new RulesNestedImpl();
    }
    public RulesNested addNewRuleLike( IngressRule item){
    return new RulesNestedImpl(item);
    }
    public T addToTls( IngressTLS ...items){
    for (IngressTLS item : items) {IngressTLSBuilder builder = new IngressTLSBuilder(item);_visitables.add(builder);this.tls.add(builder);} return (T)this;
    }
    public T removeFromTls( IngressTLS ...items){
    for (IngressTLS item : items) {IngressTLSBuilder builder = new IngressTLSBuilder(item);_visitables.remove(builder);this.tls.remove(builder);} return (T)this;
    }
    public List getTls(){
    return build(tls);
    }
    public T withTls( List tls){
    this.tls.clear();if (tls != null) {for (IngressTLS item : tls){this.addToTls(item);}} return (T) this;
    }
    public T withTls( IngressTLS ...tls){
    this.tls.clear(); if (tls != null) {for (IngressTLS item :tls){ this.addToTls(item);}} return (T) this;
    }
    public TlsNested addNewTl(){
    return new TlsNestedImpl();
    }
    public TlsNested addNewTlLike( IngressTLS item){
    return new TlsNestedImpl(item);
    }
    public T addToAdditionalProperties( String key,  Object value){
    if(key != null && value != null) {this.additionalProperties.put(key, value);} return (T)this;
    }
    public T addToAdditionalProperties( Map map){
    if(map != null) { this.additionalProperties.putAll(map);} return (T)this;
    }
    public T removeFromAdditionalProperties( String key){
    if(key != null) {this.additionalProperties.remove(key);} return (T)this;
    }
    public T removeFromAdditionalProperties( Map map){
    if(map != null) { for(Object key : map.keySet()) {this.additionalProperties.remove(key);}} return (T)this;
    }
    public Map getAdditionalProperties(){
    return this.additionalProperties;
    }
    public T withAdditionalProperties( Map additionalProperties){
    this.additionalProperties.clear();if (additionalProperties != null) {this.additionalProperties.putAll(additionalProperties);} return (T) this;
    }
    public boolean equals( Object o){
    
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
IngressSpecFluentImpl that = (IngressSpecFluentImpl) o;
if (backend != null ? !backend.equals(that.backend) :that.backend != null) return false;
if (rules != null ? !rules.equals(that.rules) :that.rules != null) return false;
if (tls != null ? !tls.equals(that.tls) :that.tls != null) return false;
if (additionalProperties != null ? !additionalProperties.equals(that.additionalProperties) :that.additionalProperties != null) return false;
return true;

    }

    public class BackendNestedImpl extends IngressBackendFluentImpl> implements BackendNested{

        private final IngressBackendBuilder builder;
    
             BackendNestedImpl (){
        this.builder = new IngressBackendBuilder(this);
        }
             BackendNestedImpl ( IngressBackend item){
        this.builder = new IngressBackendBuilder(this, item);
        }
    
            public N and(){
            return (N) IngressSpecFluentImpl.this.withBackend(builder.build());
        }
            public N endBackend(){
            return and();
        }
    
}
    public class RulesNestedImpl extends IngressRuleFluentImpl> implements RulesNested{

        private final IngressRuleBuilder builder;
    
             RulesNestedImpl (){
        this.builder = new IngressRuleBuilder(this);
        }
             RulesNestedImpl ( IngressRule item){
        this.builder = new IngressRuleBuilder(this, item);
        }
    
            public N and(){
            return (N) IngressSpecFluentImpl.this.addToRules(builder.build());
        }
            public N endRule(){
            return and();
        }
    
}
    public class TlsNestedImpl extends IngressTLSFluentImpl> implements TlsNested{

        private final IngressTLSBuilder builder;
    
             TlsNestedImpl (){
        this.builder = new IngressTLSBuilder(this);
        }
             TlsNestedImpl ( IngressTLS item){
        this.builder = new IngressTLSBuilder(this, item);
        }
    
            public N and(){
            return (N) IngressSpecFluentImpl.this.addToTls(builder.build());
        }
            public N endTl(){
            return and();
        }
    
}


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy