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

me.snowdrop.istio.api.model.v1.routing.IngressRuleFluentImpl Maven / Gradle / Ivy

package me.snowdrop.istio.api.model.v1.routing;

import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonProperty;
import me.snowdrop.istio.api.builder.Nested;
import java.lang.String;
import java.lang.Integer;
import java.lang.Deprecated;
import javax.validation.Valid;
import me.snowdrop.istio.api.builder.BaseFluent;
import java.lang.Object;
import java.lang.Boolean;

public class IngressRuleFluentImpl> extends me.snowdrop.istio.api.builder.BaseFluent implements IngressRuleFluent{

    private Object destinationServicePort;
    private IstioServiceBuilder destination;
    private MatchConditionBuilder match;
    private Integer port;
    private Integer precedence;
    private String tlsSecret;

    public IngressRuleFluentImpl(){
    }
    public IngressRuleFluentImpl(IngressRule instance){
            this.withDestinationServicePort(instance.getDestinationServicePort()); 
            this.withDestination(instance.getDestination()); 
            this.withMatch(instance.getMatch()); 
            this.withPort(instance.getPort()); 
            this.withPrecedence(instance.getPrecedence()); 
            this.withTlsSecret(instance.getTlsSecret()); 
    }

    public Object getDestinationServicePort(){
            return this.destinationServicePort;
    }

    public A withDestinationServicePort(Object destinationServicePort){
            this.destinationServicePort=destinationServicePort; return (A) this;
    }

    public Boolean hasDestinationServicePort(){
            return this.destinationServicePort != null;
    }

    
/**
 * This method has been deprecated, please use method buildDestination instead.
 */
@Deprecated public IstioService getDestination(){
            return this.destination!=null?this.destination.build():null;
    }

    public IstioService buildDestination(){
            return this.destination!=null?this.destination.build():null;
    }

    public A withDestination(IstioService destination){
            _visitables.remove(this.destination);
            if (destination!=null){ this.destination= new IstioServiceBuilder(destination); _visitables.add(this.destination);} return (A) this;
    }

    public Boolean hasDestination(){
            return this.destination != null;
    }

    public IngressRuleFluent.DestinationNested withNewDestination(){
            return new DestinationNestedImpl();
    }

    public IngressRuleFluent.DestinationNested withNewDestinationLike(IstioService item){
            return new DestinationNestedImpl(item);
    }

    public IngressRuleFluent.DestinationNested editDestination(){
            return withNewDestinationLike(getDestination());
    }

    public IngressRuleFluent.DestinationNested editOrNewDestination(){
            return withNewDestinationLike(getDestination() != null ? getDestination(): new IstioServiceBuilder().build());
    }

    public IngressRuleFluent.DestinationNested editOrNewDestinationLike(IstioService item){
            return withNewDestinationLike(getDestination() != null ? getDestination(): item);
    }

    
/**
 * This method has been deprecated, please use method buildMatch instead.
 */
@Deprecated public MatchCondition getMatch(){
            return this.match!=null?this.match.build():null;
    }

    public MatchCondition buildMatch(){
            return this.match!=null?this.match.build():null;
    }

    public A withMatch(MatchCondition match){
            _visitables.remove(this.match);
            if (match!=null){ this.match= new MatchConditionBuilder(match); _visitables.add(this.match);} return (A) this;
    }

    public Boolean hasMatch(){
            return this.match != null;
    }

    public IngressRuleFluent.MatchNested withNewMatch(){
            return new MatchNestedImpl();
    }

    public IngressRuleFluent.MatchNested withNewMatchLike(MatchCondition item){
            return new MatchNestedImpl(item);
    }

    public IngressRuleFluent.MatchNested editMatch(){
            return withNewMatchLike(getMatch());
    }

    public IngressRuleFluent.MatchNested editOrNewMatch(){
            return withNewMatchLike(getMatch() != null ? getMatch(): new MatchConditionBuilder().build());
    }

    public IngressRuleFluent.MatchNested editOrNewMatchLike(MatchCondition item){
            return withNewMatchLike(getMatch() != null ? getMatch(): item);
    }

    public Integer getPort(){
            return this.port;
    }

    public A withPort(Integer port){
            this.port=port; return (A) this;
    }

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

    public Integer getPrecedence(){
            return this.precedence;
    }

    public A withPrecedence(Integer precedence){
            this.precedence=precedence; return (A) this;
    }

    public Boolean hasPrecedence(){
            return this.precedence != null;
    }

    public String getTlsSecret(){
            return this.tlsSecret;
    }

    public A withTlsSecret(String tlsSecret){
            this.tlsSecret=tlsSecret; return (A) this;
    }

    public Boolean hasTlsSecret(){
            return this.tlsSecret != 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;
            IngressRuleFluentImpl that = (IngressRuleFluentImpl) o;
            if (destinationServicePort != null &&destinationServicePort != this ? !destinationServicePort.equals(that.destinationServicePort) :that.destinationServicePort != null &&destinationServicePort != this ) return false;

            if (destination != null ? !destination.equals(that.destination) :that.destination != null) return false;
            if (match != null ? !match.equals(that.match) :that.match != null) return false;
            if (port != null ? !port.equals(that.port) :that.port != null) return false;
            if (precedence != null ? !precedence.equals(that.precedence) :that.precedence != null) return false;
            if (tlsSecret != null ? !tlsSecret.equals(that.tlsSecret) :that.tlsSecret != null) return false;
            return true;
    }


    public class DestinationNestedImpl extends IstioServiceFluentImpl> implements IngressRuleFluent.DestinationNested,me.snowdrop.istio.api.builder.Nested{

            private final IstioServiceBuilder builder;
    
            DestinationNestedImpl(IstioService item){
                    this.builder = new IstioServiceBuilder(this, item);
            }
            DestinationNestedImpl(){
                    this.builder = new IstioServiceBuilder(this);
            }
    
    public N and(){
            return (N) IngressRuleFluentImpl.this.withDestination(builder.build());
    }
    public N endDestination(){
            return and();
    }

}
    public class MatchNestedImpl extends MatchConditionFluentImpl> implements IngressRuleFluent.MatchNested,me.snowdrop.istio.api.builder.Nested{

            private final MatchConditionBuilder builder;
    
            MatchNestedImpl(MatchCondition item){
                    this.builder = new MatchConditionBuilder(this, item);
            }
            MatchNestedImpl(){
                    this.builder = new MatchConditionBuilder(this);
            }
    
    public N and(){
            return (N) IngressRuleFluentImpl.this.withMatch(builder.build());
    }
    public N endMatch(){
            return and();
    }

}


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy