title: Guice - Injecting different value to string variable per instance
body: <p>Using Guice,I would like create three different instances for my Color class i.e BLUE, RED, YELLOW and want to bind different color value... but I am not understanding how to bind different value per instance... </p>
  
  <p>For the below sample code, if you see, I would like to use same ColorClass implementation for all three colors Instances(named as "BLUE","RED","ORANGE") by passing different color as String variable.</p>
  
  <pre><code>public interface ColorInterface {
      public String getMeColor()
  }
  </code></pre>
  
  <p>Sample implementation....</p>
  
  <pre><code>public class ColorClass implements ColorInterface {
      @Inject @Named("color")
      String color
  
      public String getMeColor(){
          return color
      } 
  
  }
  </code></pre>
  
  <p>Sample binding........</p>
  
  <pre><code>public class ColorModule extends AbstractModule {
  
      @Override
      protected void configure() {
  
               bind(ColorInterface.class).annotatedWith(Names.named("BLUE")).to(ColorClass.class);
               bind(ColorInterface.class).annotatedWith(Names.named("RED")).to(ColorClass.class);
               bind(ColorInterface.class).annotatedWith(Names.named("ORANGE")).to(ColorClass.class);
  
              ......
      }
  
  }
  </code></pre>
  
  <p>Please help me...</p>