io.fabric8.kubernetes.api.model.ServicePortFluent Maven / Gradle / Ivy
package io.fabric8.kubernetes.api.model;
import io.fabric8.kubernetes.api.model.util.IntOrString;
import java.util.HashMap;
import java.util.Map;
import io.fabric8.common.Nested;
import io.fabric8.kubernetes.api.model.util.IntOrStringBuilder;
import io.fabric8.kubernetes.api.model.util.IntOrStringFluent;
import io.fabric8.common.Builder;
import io.fabric8.common.Fluent;
import io.fabric8.common.BaseFluent;
import io.fabric8.common.Visitable;
public class ServicePortFluent> extends BaseFluent implements Fluent{
String name; Integer port; String protocol; IntOrStringBuilder targetPort; Map additionalProperties = new HashMap();
public String getName(){
return this.name;
}
public T withName( String name){
this.name=name; return (T) this;
}
public Integer getPort(){
return this.port;
}
public T withPort( Integer port){
this.port=port; return (T) this;
}
public String getProtocol(){
return this.protocol;
}
public T withProtocol( String protocol){
this.protocol=protocol; return (T) this;
}
public IntOrString getTargetPort(){
return this.targetPort!=null?this.targetPort.build():null;
}
public T withTargetPort( IntOrString targetPort){
if (targetPort!=null){ this.targetPort= new IntOrStringBuilder(targetPort); _visitables.add(this.targetPort);} return (T) this;
}
public TargetPortNested withNewTargetPort(){
return new TargetPortNested();
}
public T withNewTargetPort( Integer intVal){
return withTargetPort(new IntOrString(intVal));
}
public T withNewTargetPort( String strVal){
return withTargetPort(new IntOrString(strVal));
}
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 TargetPortNested extends IntOrStringFluent> implements Nested{
private final IntOrStringBuilder builder = new IntOrStringBuilder(this);
public N and(){
return (N) ServicePortFluent.this.withTargetPort(builder.build());
}
public N endTargetPort(){
return and();
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy