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

me.snowdrop.istio.api.model.v1.networking.ServerBuilder 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 ServerBuilder extends ServerFluentImpl implements VisitableBuilder{

    ServerFluent fluent;
    Boolean validationEnabled;

    public ServerBuilder(){
            this(true);
    }
    public ServerBuilder(Boolean validationEnabled){
            this(new Server(), validationEnabled);
    }
    public ServerBuilder(ServerFluent fluent){
            this(fluent, true);
    }
    public ServerBuilder(ServerFluent fluent,Boolean validationEnabled){
            this(fluent, new Server(), validationEnabled);
    }
    public ServerBuilder(ServerFluent fluent,Server instance){
            this(fluent, instance, true);
    }
    public ServerBuilder(ServerFluent fluent,Server instance,Boolean validationEnabled){
            this.fluent = fluent; 
            fluent.withHosts(instance.getHosts()); 
            fluent.withPort(instance.getPort()); 
            fluent.withTls(instance.getTls()); 
            this.validationEnabled = validationEnabled; 
    }
    public ServerBuilder(Server instance){
            this(instance,true);
    }
    public ServerBuilder(Server instance,Boolean validationEnabled){
            this.fluent = this; 
            this.withHosts(instance.getHosts()); 
            this.withPort(instance.getPort()); 
            this.withTls(instance.getTls()); 
            this.validationEnabled = validationEnabled; 
    }

    public Server build(){
            Server buildable = new Server(fluent.getHosts(),fluent.getPort(),fluent.getTls());
            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;
            ServerBuilder that = (ServerBuilder) 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