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

io.fabric8.kubernetes.api.model.ServiceSpecFluent Maven / Gradle / Ivy

package io.fabric8.kubernetes.api.model;

import java.util.HashMap;
import java.util.Map;
import java.util.List;
import java.util.ArrayList;
import io.fabric8.common.Nested;
import io.fabric8.common.Fluent;

public class ServiceSpecFluent> implements Fluent{

    private Boolean createExternalLoadBalancer ;
    private String portalIP ;
    private List ports  = new ArrayList();
    private List publicIPs  = new ArrayList();
    private Map selector  = new HashMap();
    private String sessionAffinity ;
    private Map additionalProperties  = new HashMap();

    public Boolean isCreateExternalLoadBalancer(){
    return this.createExternalLoadBalancer;
    }
    public T withCreateExternalLoadBalancer(Boolean createExternalLoadBalancer){
    this.createExternalLoadBalancer=createExternalLoadBalancer; return (T) this;
    }
    public String getPortalIP(){
    return this.portalIP;
    }
    public T withPortalIP(String portalIP){
    this.portalIP=portalIP; return (T) this;
    }
    public List getPorts(){
    return this.ports;
    }
    public T withPorts(List ports){
    this.ports.clear();if (ports != null) {this.ports.addAll(ports);} return (T) this;
    }
    public List getPublicIPs(){
    return this.publicIPs;
    }
    public T withPublicIPs(List publicIPs){
    this.publicIPs.clear();if (publicIPs != null) {this.publicIPs.addAll(publicIPs);} return (T) this;
    }
    public Map getSelector(){
    return this.selector;
    }
    public T withSelector(Map selector){
    this.selector.clear();if (selector != null) {this.selector.putAll(selector);} return (T) this;
    }
    public String getSessionAffinity(){
    return this.sessionAffinity;
    }
    public T withSessionAffinity(String sessionAffinity){
    this.sessionAffinity=sessionAffinity; 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 T addToPorts(ServicePort item){
    if (item != null) {this.ports.add(item);} return (T)this;
    }
    public PortsNested addNewPort(){
    return new PortsNested();
    }
    public T addToPublicIPs(String item){
    if (item != null) {this.publicIPs.add(item);} return (T)this;
    }
    public T addToSelector(String key, String value){
    if(key != null && value != null) {this.selector.put(key, value);} return (T)this;
    }
    public T addToAdditionalProperties(String key, Object value){
    if(key != null && value != null) {this.additionalProperties.put(key, value);} return (T)this;
    }

    public class PortsNested extends ServicePortFluent> implements Nested{

        private final ServicePortBuilder builder = new ServicePortBuilder(this);
    
            public N endPort(){
            return and();
        }
            public N and(){
            return (N) ServiceSpecFluent.this.addToPorts(builder.build());
        }
    
}


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy