package com.opentable.jaxrs.clientfactory;

import javax.ws.rs.client.Client;

/**
 * A factory for producing JAX-RS clients with low-level socket-handling
 * details set in a implementation-independent way.
 * <p>
 * Doesn't tie you to any particular implementation at compile time.
 * </p>
 */
public interface JaxRsClientBuilder
{

    /**
     * Register a component instance for use in the client
     * @param object - the component instance to use
     * @return this for continued building
     */
    JaxRsClientBuilder register(Object object);

    /**
     * Register a component class for use in the client
     * @param clazz - the component class to use
     * @return this for continued building
     */
    JaxRsClientBuilder register(Class<?> clazz);

    /**
     * Apply a configuration to this client builder, to apply settings in the HttpClient.
     * @return this for continued building
     */
    JaxRsClientBuilder withConfiguration(JaxRsClientConfig config);

    /**
     * @return the completed JAX-RS client
     */
    Client build();

    /**
     * @return an instance of the currently bound ClientFactory. There should be only one.
     */
    static JaxRsClientBuilder newInstance() {
        return JaxRsClientBuilderUtil.newInstance();
    }
}

@@ -52,29 +52,112 @@
 java
-x.ws.rs.client.Client
+.util.Properties;%0A%0Aimport javax.ws.rs.client.Client;%0A%0Aimport org.skife.config.ConfigurationObjectFactory
 ;%0A%0A/
@@ -1059,24 +1059,424 @@
 g config);%0A%0A
+    /**%0A     * Apply a configuration to this client builder, to apply settings in the HttpClient.%0A     * @return this for continued building%0A     */%0A    default JaxRsClientBuilder withConfiguration(Properties configProperties) %7B%0A        final JaxRsClientConfig config = new ConfigurationObjectFactory(configProperties).build(JaxRsClientConfig.class);%0A        return withConfiguration(config);%0A    %7D%0A%0A
     /**%0A    

add properties slurper for JaxRsClientBuilder