@Test public void decodesArraysWithLists() throws IOException { String json = "{\n" + " \"a\": [\n" + " \"b\",\n" + " \"c\",\n" + " \"d\"\n" + " ]\n" + "}"; Map<String, Object> expected = ImmutableMap.<String, Object>builder().put("a", Arrays.asList("b", "c", "d")).build(); assertThat(cartographer.fromJson(json)).isEqualTo(expected); }
public Map<String, Object> fromJson(String json) throws IOException { if (json == null) { throw new IllegalArgumentException("json == null"); } if (json.length() == 0) { throw new IllegalArgumentException("json empty"); } return fromJson(new StringReader(json)); }
Cartographer { public Map<String, Object> fromJson(String json) throws IOException { if (json == null) { throw new IllegalArgumentException("json == null"); } if (json.length() == 0) { throw new IllegalArgumentException("json empty"); } return fromJson(new StringReader(json)); } }
Cartographer { public Map<String, Object> fromJson(String json) throws IOException { if (json == null) { throw new IllegalArgumentException("json == null"); } if (json.length() == 0) { throw new IllegalArgumentException("json empty"); } return fromJson(new StringReader(json)); } Cartographer(boolean isLenient, boolean prettyPrint); }
Cartographer { public Map<String, Object> fromJson(String json) throws IOException { if (json == null) { throw new IllegalArgumentException("json == null"); } if (json.length() == 0) { throw new IllegalArgumentException("json empty"); } return fromJson(new StringReader(json)); } Cartographer(boolean isLenient, boolean prettyPrint); Map<String, Object> fromJson(String json); Map<String, Object> fromJson(Reader reader); String toJson(Map<?, ?> map); void toJson(Map<?, ?> map, Writer writer); }
Cartographer { public Map<String, Object> fromJson(String json) throws IOException { if (json == null) { throw new IllegalArgumentException("json == null"); } if (json.length() == 0) { throw new IllegalArgumentException("json empty"); } return fromJson(new StringReader(json)); } Cartographer(boolean isLenient, boolean prettyPrint); Map<String, Object> fromJson(String json); Map<String, Object> fromJson(Reader reader); String toJson(Map<?, ?> map); void toJson(Map<?, ?> map, Writer writer);  }