title: Reading values from a property file into a Map<PropertyName, ListOfValues>?
body: <p>I have the following property file </p>
  
  <ul>
  <li>MyCat.MyVal1=a,b,c,d,e</li>
  <li>MyCat.MyVal2=z,d,e</li>
  <li>MyCat.MyVal3=a,b</li>
  </ul>
  
  <p>And need to construct a map with key being the key of the property file and the value a list Strings being the property value e.g. MyMap(String,List)</p>
  
  <p>Example having a map with</p>
  
  <ul>
  <li>Key = MyCat.MyVal1 value List a,b,c,d,e</li>
  <li>Key = MyCat.MyVal2 value List z,d,e</li>
  </ul>
  
  <p>Now I know you can read a specific value from a property file using Spring into a list</p>
  
  <pre><code>@Component
  class MyClass {
  @Value("${my.property.name}")
  private String[] myValues;
  }
  </code></pre>
  
  <p>And ultimately the only way I can figure out how to do this is to write a custom class to read all the properties line by line and take the value of the property and split them and create a list from based on that and construct a map.</p>
  
  <p>Just wanted to ask if there is an easier way of doing this?</p>