title: Strings, Lists and Maps in properties files - how to define Maps?
body: <p>If given a .properties file and asked to add a named value for, say, a background colour, one would do something like:</p>
  
  <pre><code>page.background.colour=white
  </code></pre>
  
  <p>If further down the track there's a new requirement to define a named list of colours one would either use a comma:</p>
  
  <pre><code>page.background.colours=white,grey,black
  </code></pre>
  
  <p>or also possibly a repeated property name:</p>
  
  <pre><code>page.background.colours=white
  page.background.colours=grey
  page.background.colours=black
  </code></pre>
  
  <p>now what would one do to define a named map? Say, there's a dropdown list for colours like: </p>
  
  <pre><code>&lt;select name="page.background.colours"&gt;
     &lt;option value="#FFFFFF"&gt;White&lt;/option&gt;
     &lt;option value="#CCCCCC"&gt;Grey&lt;/option&gt;
     &lt;option value="#000000"&gt;Black&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>The following jumps to mind but somehow there's a feeling that I'm forcing a square bar into a round hole:</p>
  
  <pre><code>page.background.colours.#FFFFFF=White
  page.background.colours.#CCCCCC=Grey
  page.background.colours.#000000=Black
  </code></pre>
  
  <p>Further down, how to ensure the order where white is first and black is last? The following jumps to mind but again, feels wrong:</p>
  
  <pre><code>page.background.colours.#FFFFFF.follows=
  page.background.colours.#CCCCCC.follows=page.background.colours.#FFFFFF
  page.background.colours.#000000.follows=page.background.colours.#CCCCCC
  </code></pre>
  
  <p>I know about XML, JSON and such but I want to stick with .properties file, if possible.</p>
  
  <p>Thanks for your thoughts!</p>