title: Using Spring IoC to set up enum values
body: <p>Is there a way to set up such enum values via Spring IoC at construction time?</p>
  
  <p>What I would like to do is to inject, at class load time, values that are hard-coded in the code snippet below:</p>
  
  <pre><code>public enum Car
  {
          NANO ("Very Cheap", "India"),
          MERCEDES ("Expensive", "Germany"),
          FERRARI ("Very Expensive", "Italy");
  
          public final String cost;
          public final String madeIn;
  
          Car(String cost, String madeIn)
          {
                  this.cost= cost;
                  this.madeIn= madeIn;
          }
  
  }
  </code></pre>
  
  <p>Let's say that the application must be deployed in Germany, where Nanos are "Nearly free", or in India where Ferraris are "Unaffordable". In both countries, there are only three cars (deterministic set), no more no less, hence an enum, but their "inner" values may differ. So, this is a case of contextual <strong>initialization</strong> of immutables.</p>