title: How to use Guice Assisted Inject for this factory pattern?
body: <p>The following is a factory pattern that I wrote. But, in order to change it into a Provider, Guice <a href="https://github.com/google/guice/wiki/AssistedInject" rel="nofollow noreferrer">documentation</a> is not quite helping. </p>
  
  <pre><code>class ClientA extends AbstractClient {...}
  </code></pre>
  
  <pre><code>class ClientB extends AbstractClient {...}
  </code></pre>
  
  <pre><code>class ClientUtil {
          private static AbstractClient client;
          public static AbstractClient getClient(String key) {
              ClientType clientType = ....
              switch(clientType) {
                  case ".." : client = new ClientA.Builder()....build();
                              break;
                  case "..." :
                  default : client= new ClientB.Builder()....build();
              }
              return client;
          }
  }
  </code></pre>
  
  <pre><code>class Application {
          AbstractClient client = ClientUtil.getClient(key);  // here, key is a string which is dynamic
      }
  </code></pre>
  
  <p>Please provide some suggestions on how this can be written in a Provider format with Guice AssistedInject.</p>