title: Are there any advantages between List<CustomObject> and HashMap <String, Object>
body: <p>I am trying to implement a solution (in Java 1.6) where i need to store some values (for a set of properties) and thinking in three options considering the following three (Any other idea is of course wellcome!)</p>
  
  <p><strong>Option 1</strong></p>
  
  <p>Create a class (call it <code>Property</code>) that can store different type of objects (String, int, boolean...) and and work with the set of properties as a  <code>List&lt;Property&gt;</code></p>
  
  <p>Something like:</p>
  
  <pre><code>private String type; //Store the type of Object
  private String name; //Store the name of the property
  private String valueStr; //Store the String value
  private int valueInt; //Store the int value
  private boolean valueBool; //Store the boolean value
  </code></pre>
  
  <p>I dont really like the idea of having many properties and using only one of them. (only one of the values will be set per property)</p>
  
  <p><strong>Option 2</strong></p>
  
  <p>Use <code>HashMap&lt;String, Object&gt;</code> and parse the type on each case.</p>
  
  <p>Have the good thing that you can get the <code>Property</code> by name</p>
  
  <p><strong>Option 3</strong></p>
  
  <p>Use <code>HashMap&lt;String, Property&gt;</code> Where the String is the name of the property and you can get the value with the name and no need to parse.</p>
  
  <p>Questions are:
  Which of one you think is the best one? 
  or if none of them are good i would like to hear other ideas</p>
  
  <p>Also is there any performance difference between the List and the HashMap?</p>
  
  <p>Thanks in advance for the help.</p>