RowanChrismtas - 10/03/05 - enforcing the String as Key, Value as type would be even easier if the methods were just a part of the API directly, imo.
EthanCerami - 10/5/05 - However, your proposed approach doesn't provide compile-time checks either. Here's an example method from CytoscapeData:
1 public int putAttributeKeyValue (String identifier, String attribute,
2 String key, Object value);
3
The only way to enforce checking at compile time is to create a whole suite of methods, e.g.
1 public int putAttributeKeyValue (String identifier, String attribute,
2 String key, String value);
3 public int putAttributeKeyValue (String identifier, String attribute,
4 String key, Boolean value);
5 public int putAttributeKeyValue (String identifier, String attribute,
6 String key, Integer value);
7 public int putAttributeKeyValue (String identifier, String attribute,
8 String key, Double value);
9
And, I think we can agree that this will result in way too many methods.
EthanCerami - 10/4/05 - Subgroup (Nerius, Iliana, Ethan) agreed to go with single set of getters/setters for Lists and Maps, e.g. we vote to go with setAttributeList(List list), and setAttributeMap(Map map).