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

io.fabric8.docker.client.ConfigBuilder Maven / Gradle / Ivy

There is a newer version: 1.3.1
Show newest version
package io.fabric8.docker.client;

import org.slf4j.Logger;
import com.fasterxml.jackson.databind.JavaType;
import java.util.Map;
import java.util.Map;
import java.util.regex.Pattern;
import com.fasterxml.jackson.databind.JsonSerializable;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.fabric8.docker.api.model.AuthConfig;
import com.fasterxml.jackson.core.ObjectCodec;
import com.fasterxml.jackson.core.TreeCodec;
import java.util.HashMap;
import java.io.Serializable;
import java.lang.reflect.Type;
import java.util.AbstractMap;
import com.fasterxml.jackson.databind.type.MapLikeType;
import com.fasterxml.jackson.databind.type.MapType;
import com.fasterxml.jackson.core.type.ResolvedType;
import com.fasterxml.jackson.core.Versioned;
import com.fasterxml.jackson.databind.type.TypeBase;
import io.sundr.builder.Builder;
import io.sundr.builder.Visitable;
import io.sundr.builder.Visitable;
import io.sundr.builder.Fluent;
import io.sundr.builder.VisitableBuilder;
import io.sundr.builder.BaseFluent;

public class ConfigBuilder extends ConfigFluentImpl implements VisitableBuilder{

     ConfigFluent fluent;

    public ConfigBuilder(){
        this(new Config());
    }
    public ConfigBuilder( ConfigFluent fluent ){
        this(fluent, new Config());
    }
    public ConfigBuilder( ConfigFluent fluent , Config instance ){
        this.fluent = fluent; fluent.withTrustCerts(instance.isTrustCerts()); fluent.withMasterUrl(instance.getMasterUrl()); fluent.withCaCertFile(instance.getCaCertFile()); fluent.withCaCertData(instance.getCaCertData()); fluent.withClientCertFile(instance.getClientCertFile()); fluent.withClientCertData(instance.getClientCertData()); fluent.withClientKeyFile(instance.getClientKeyFile()); fluent.withClientKeyData(instance.getClientKeyData()); fluent.withClientKeyAlgo(instance.getClientKeyAlgo()); fluent.withClientKeyPassphrase(instance.getClientKeyPassphrase()); fluent.withUsername(instance.getUsername()); fluent.withPassword(instance.getPassword()); fluent.withOauthToken(instance.getOauthToken()); fluent.withImageBuildTimeout(instance.getImageBuildTimeout()); fluent.withImagePushTimeout(instance.getImagePushTimeout()); fluent.withImageSearchTimeout(instance.getImageSearchTimeout()); fluent.withConnectionTimeout(instance.getConnectionTimeout()); fluent.withRequestTimeout(instance.getRequestTimeout()); fluent.withHttpProxy(instance.getHttpProxy()); fluent.withHttpsProxy(instance.getHttpsProxy()); fluent.withNoProxy(instance.getNoProxy()); fluent.withAuthConfigs(instance.getAuthConfigs()); 
    }
    public ConfigBuilder( Config instance ){
        this.fluent = this; this.withTrustCerts(instance.isTrustCerts()); this.withMasterUrl(instance.getMasterUrl()); this.withCaCertFile(instance.getCaCertFile()); this.withCaCertData(instance.getCaCertData()); this.withClientCertFile(instance.getClientCertFile()); this.withClientCertData(instance.getClientCertData()); this.withClientKeyFile(instance.getClientKeyFile()); this.withClientKeyData(instance.getClientKeyData()); this.withClientKeyAlgo(instance.getClientKeyAlgo()); this.withClientKeyPassphrase(instance.getClientKeyPassphrase()); this.withUsername(instance.getUsername()); this.withPassword(instance.getPassword()); this.withOauthToken(instance.getOauthToken()); this.withImageBuildTimeout(instance.getImageBuildTimeout()); this.withImagePushTimeout(instance.getImagePushTimeout()); this.withImageSearchTimeout(instance.getImageSearchTimeout()); this.withConnectionTimeout(instance.getConnectionTimeout()); this.withRequestTimeout(instance.getRequestTimeout()); this.withHttpProxy(instance.getHttpProxy()); this.withHttpsProxy(instance.getHttpsProxy()); this.withNoProxy(instance.getNoProxy()); this.withAuthConfigs(instance.getAuthConfigs()); 
    }

public EditableConfig build(){
    EditableConfig buildable = new EditableConfig(fluent.isTrustCerts(),fluent.getMasterUrl(),fluent.getCaCertFile(),fluent.getCaCertData(),fluent.getClientCertFile(),fluent.getClientCertData(),fluent.getClientKeyFile(),fluent.getClientKeyData(),fluent.getClientKeyAlgo(),fluent.getClientKeyPassphrase(),fluent.getUsername(),fluent.getPassword(),fluent.getOauthToken(),fluent.getImageBuildTimeout(),fluent.getImagePushTimeout(),fluent.getImageSearchTimeout(),fluent.getConnectionTimeout(),fluent.getRequestTimeout(),fluent.getHttpProxy(),fluent.getHttpsProxy(),fluent.getNoProxy(),fluent.getAuthConfigs());
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;
ConfigBuilder that = (ConfigBuilder) o;
if (fluent != null &&fluent != this ? !fluent.equals(that.fluent) :that.fluent != null &&fluent != this ) return false;
return true;

}

private  void validate(T item) {}


}
    




© 2015 - 2024 Weber Informatics LLC | Privacy Policy