io.fabric8.kubernetes.api.model.EndpointSubsetFluent 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.Builder;
import io.fabric8.common.Fluent;
import io.fabric8.common.BaseFluent;
import io.fabric8.common.Visitable;
public class EndpointSubsetFluent> extends BaseFluent implements Fluent{
List addresses = new ArrayList(); List ports = new ArrayList(); Map additionalProperties = new HashMap();
public T addToAddresses( EndpointAddress item){
if (item != null) {EndpointAddressBuilder builder = new EndpointAddressBuilder(item);_visitables.add(builder);this.addresses.add(builder);} return (T)this;
}
public List getAddresses(){
return build(addresses);
}
public T withAddresses( List addresses){
this.addresses.clear();if (addresses != null) {for (EndpointAddress item : addresses){this.addToAddresses(item);}} return (T) this;
}
public AddressesNested addNewAddresse(){
return new AddressesNested();
}
public T addToPorts( EndpointPort item){
if (item != null) {EndpointPortBuilder builder = new EndpointPortBuilder(item);_visitables.add(builder);this.ports.add(builder);} return (T)this;
}
public List getPorts(){
return build(ports);
}
public T withPorts( List ports){
this.ports.clear();if (ports != null) {for (EndpointPort item : ports){this.addToPorts(item);}} return (T) this;
}
public PortsNested addNewPort(){
return new PortsNested();
}
public T addNewPort( String name, Integer port, String protocol){
return addToPorts(new EndpointPort(name, port, protocol));
}
public T addToAdditionalProperties( String key, Object value){
if(key != null && value != null) {this.additionalProperties.put(key, value);} 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 class AddressesNested extends EndpointAddressFluent> implements Nested{
private final EndpointAddressBuilder builder = new EndpointAddressBuilder(this);
public N and(){
return (N) EndpointSubsetFluent.this.addToAddresses(builder.build());
}
public N endAddresse(){
return and();
}
}
public class PortsNested extends EndpointPortFluent> implements Nested{
private final EndpointPortBuilder builder = new EndpointPortBuilder(this);
public N endPort(){
return and();
}
public N and(){
return (N) EndpointSubsetFluent.this.addToPorts(builder.build());
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy