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

me.snowdrop.istio.api.model.v1.networking.DestinationFluentImpl 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.lang.String;
import java.lang.Deprecated;
import javax.validation.Valid;
import io.fabric8.kubernetes.api.builder.BaseFluent;
import java.lang.Object;
import java.lang.Boolean;

public class DestinationFluentImpl> extends io.fabric8.kubernetes.api.builder.BaseFluent implements DestinationFluent{

    private String host;
    private PortSelectorBuilder port;
    private String subset;

    public DestinationFluentImpl(){
    }
    public DestinationFluentImpl(Destination instance){
            this.withHost(instance.getHost()); 
            this.withPort(instance.getPort()); 
            this.withSubset(instance.getSubset()); 
    }

    public String getHost(){
            return this.host;
    }

    public A withHost(String host){
            this.host=host; return (A) this;
    }

    public Boolean hasHost(){
            return this.host != null;
    }

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

    public PortSelector buildPort(){
            return this.port!=null?this.port.build():null;
    }

    public A withPort(PortSelector port){
            _visitables.remove(this.port);
            if (port!=null){ this.port= new PortSelectorBuilder(port); _visitables.add(this.port);} return (A) this;
    }

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

    public A withNewPort(Object port){
            return (A)withPort(new PortSelector(port));
    }

    public DestinationFluent.PortNested withNewPort(){
            return new PortNestedImpl();
    }

    public DestinationFluent.PortNested withNewPortLike(PortSelector item){
            return new PortNestedImpl(item);
    }

    public DestinationFluent.PortNested editPort(){
            return withNewPortLike(getPort());
    }

    public DestinationFluent.PortNested editOrNewPort(){
            return withNewPortLike(getPort() != null ? getPort(): new PortSelectorBuilder().build());
    }

    public DestinationFluent.PortNested editOrNewPortLike(PortSelector item){
            return withNewPortLike(getPort() != null ? getPort(): item);
    }

    public String getSubset(){
            return this.subset;
    }

    public A withSubset(String subset){
            this.subset=subset; return (A) this;
    }

    public Boolean hasSubset(){
            return this.subset != null;
    }

    public boolean equals(Object o){
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            if (!super.equals(o)) return false;
            DestinationFluentImpl that = (DestinationFluentImpl) o;
            if (host != null ? !host.equals(that.host) :that.host != null) return false;
            if (port != null ? !port.equals(that.port) :that.port != null) return false;
            if (subset != null ? !subset.equals(that.subset) :that.subset != null) return false;
            return true;
    }


    public class PortNestedImpl extends PortSelectorFluentImpl> implements DestinationFluent.PortNested,io.fabric8.kubernetes.api.builder.Nested{

            private final PortSelectorBuilder builder;
    
            PortNestedImpl(PortSelector item){
                    this.builder = new PortSelectorBuilder(this, item);
            }
            PortNestedImpl(){
                    this.builder = new PortSelectorBuilder(this);
            }
    
    public N and(){
            return (N) DestinationFluentImpl.this.withPort(builder.build());
    }
    public N endPort(){
            return and();
    }

}


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy