@Test public void mixedNumericJson() { String json = "[ {'foo1':'bar1', 'foo2':2} ]"; List<MapRecord> records = JsonRecords.parseAsMap(json); Assert.assertEquals(1, records.size()); MapRecord record = records.get(0); Column c = Column.create("foo1"); Assert.assertTrue("Map does not contain key: " + record, record.containsKey(c)); Assert.assertEquals(StringRecordValue.class, record.get(c).getClass()); Assert.assertEquals("bar1", record.get(c).value()); c = Column.create("foo2"); Assert.assertTrue("Map does not contain key: " + record, record.containsKey(c)); Assert.assertEquals(IntegerRecordValue.class, record.get(c).getClass()); Assert.assertEquals(2, record.get(c).value()); }
public static List<MapRecord> parseAsMap(File jsonFile) throws FileNotFoundException, IOException, JsonSyntaxException { return parseAsMap(jsonFile, new CountingDocIdGenerator()); }
JsonRecords { public static List<MapRecord> parseAsMap(File jsonFile) throws FileNotFoundException, IOException, JsonSyntaxException { return parseAsMap(jsonFile, new CountingDocIdGenerator()); } }
JsonRecords { public static List<MapRecord> parseAsMap(File jsonFile) throws FileNotFoundException, IOException, JsonSyntaxException { return parseAsMap(jsonFile, new CountingDocIdGenerator()); }  }
JsonRecords { public static List<MapRecord> parseAsMap(File jsonFile) throws FileNotFoundException, IOException, JsonSyntaxException { return parseAsMap(jsonFile, new CountingDocIdGenerator()); }  static List<MapRecord> parseAsMap(File jsonFile); static List<MultimapRecord> parseAsMultimap(File jsonFile); static List<MapRecord> parseAsMap(File jsonFile, DocIdGenerator generator); static List<MultimapRecord> parseAsMultimap(File jsonFile, DocIdGenerator generator); static List<MapRecord> parseAsMap(String json); static List<MultimapRecord> parseAsMultimap(String json); static List<MapRecord> parseAsMap(String json, DocIdGenerator generator); static List<MultimapRecord> parseAsMultimap(String json, DocIdGenerator generator); }
JsonRecords { public static List<MapRecord> parseAsMap(File jsonFile) throws FileNotFoundException, IOException, JsonSyntaxException { return parseAsMap(jsonFile, new CountingDocIdGenerator()); }  static List<MapRecord> parseAsMap(File jsonFile); static List<MultimapRecord> parseAsMultimap(File jsonFile); static List<MapRecord> parseAsMap(File jsonFile, DocIdGenerator generator); static List<MultimapRecord> parseAsMultimap(File jsonFile, DocIdGenerator generator); static List<MapRecord> parseAsMap(String json); static List<MultimapRecord> parseAsMultimap(String json); static List<MapRecord> parseAsMap(String json, DocIdGenerator generator); static List<MultimapRecord> parseAsMultimap(String json, DocIdGenerator generator);  }