I am looking for a Map-like collection that would allow me to create new object in a PHP/Python/JavaScript way:
var foo = new Foo({'foo': 'bar'})
The closest I have in Java is HashMap:
Map<String, String> parameters = new HashMap<String, String>();
parameters.put("test", "one two");
parameters.put("foo", "bar");
This is too verbose for my purpose. I would like to write down and handle over key-value pairs in an easier way.
I welcome any suggestions - creating own type of collection, creating own factory for a Map object etc. I just want to axe number of characters needed to write down to create such a collection.