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

me.snowdrop.istio.api.model.v1.networking.GatewayBuilder Maven / Gradle / Ivy

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

import io.fabric8.kubernetes.api.builder.VisitableBuilder;
import java.lang.Object;
import java.lang.Boolean;

public class GatewayBuilder extends GatewayFluentImpl implements VisitableBuilder{

    GatewayFluent fluent;
    Boolean validationEnabled;

    public GatewayBuilder(){
            this(true);
    }
    public GatewayBuilder(Boolean validationEnabled){
            this(new Gateway(), validationEnabled);
    }
    public GatewayBuilder(GatewayFluent fluent){
            this(fluent, true);
    }
    public GatewayBuilder(GatewayFluent fluent,Boolean validationEnabled){
            this(fluent, new Gateway(), validationEnabled);
    }
    public GatewayBuilder(GatewayFluent fluent,Gateway instance){
            this(fluent, instance, true);
    }
    public GatewayBuilder(GatewayFluent fluent,Gateway instance,Boolean validationEnabled){
            this.fluent = fluent; 
            fluent.withSelector(instance.getSelector()); 
            fluent.withServers(instance.getServers()); 
            this.validationEnabled = validationEnabled; 
    }
    public GatewayBuilder(Gateway instance){
            this(instance,true);
    }
    public GatewayBuilder(Gateway instance,Boolean validationEnabled){
            this.fluent = this; 
            this.withSelector(instance.getSelector()); 
            this.withServers(instance.getServers()); 
            this.validationEnabled = validationEnabled; 
    }

    public Gateway build(){
            Gateway buildable = new Gateway(fluent.getSelector(),fluent.getServers());
            io.fabric8.kubernetes.api.builder.ValidationUtils.validate(buildable);
            return buildable;
    }

    public boolean equals(Object o){
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            if (!super.equals(o)) return false;
            GatewayBuilder that = (GatewayBuilder) o;
            if (fluent != null &&fluent != this ? !fluent.equals(that.fluent) :that.fluent != null &&fluent != this ) return false;

            if (validationEnabled != null ? !validationEnabled.equals(that.validationEnabled) :that.validationEnabled != null) return false;
            return true;
    }




}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy