@SuppressWarnings("unchecked") @Test public void testParseOk() { Map<String, Object> map = parseMap("a=b,c=d"); Assert.assertEquals(CollectionUtil.newMap(new String[] { "a", "c" }, new String[] { "b", "d" }), map); map = parseMap("{a=b,c=d}"); Assert.assertEquals(CollectionUtil.newMap(new String[] { "a", "c" }, new String[] { "b", "d" }), map); map = parseMap("{name=Tom,surname=Scott,address={town=London,street=Some street,number={n1=10,n2=1234}}}"); assertEquals("Tom", map.get("name")); assertEquals("Scott", map.get("surname")); final Map testMap = CollectionUtil.newMap("town", "London", "street", "Some street"); testMap.put("number", CollectionUtil.newMap("n1", "10", "n2", "1234")); assertEquals(testMap, map.get("address")); map = parseMap("a=,c=d"); Assert.assertEquals(CollectionUtil.newMap("a", null, "c", "d"), map); map = parseMap(""); Assert.assertEquals(new HashMap(), map); map = parseMap(null); Assert.assertEquals(new HashMap(), map); map = parseMap("quates="); System.out.println(map); }
public static Map<String, Object> parseMap(String string, ConnectorMessages cm) { return parseMapInternal(string, cm); }
MapParser { public static Map<String, Object> parseMap(String string, ConnectorMessages cm) { return parseMapInternal(string, cm); } }
MapParser { public static Map<String, Object> parseMap(String string, ConnectorMessages cm) { return parseMapInternal(string, cm); } private  MapParser(); }
MapParser { public static Map<String, Object> parseMap(String string, ConnectorMessages cm) { return parseMapInternal(string, cm); } private  MapParser(); static Map<String, Object> parseMap(String string, ConnectorMessages cm); }
MapParser { public static Map<String, Object> parseMap(String string, ConnectorMessages cm) { return parseMapInternal(string, cm); } private  MapParser(); static Map<String, Object> parseMap(String string, ConnectorMessages cm);  }