@Test public void should_strip_quotes_in_header() { List<String> list = Arrays.asList("\"user_id\";\"birth\";\"country\";page_visited;first_item", "4dc1548af;11/9/1970;France;6.0;22.0"); Separator separator = new Separator(';'); separator.incrementCount(1); CSVFastHeaderAndTypeAnalyzer analysis = new CSVFastHeaderAndTypeAnalyzer(list, separator); List<String> expectedHeaders = Arrays.asList("user_id", "birth", "country", "page_visited", "first_item"); Assert.assertArrayEquals(expectedHeaders.toArray(), analysis.getHeaders().stream().map(p -> p.getKey()).toArray()); }
public List<Pair<String, Type>> getHeaders() { if (!analysisPerformed) { analyze(); } return headers; }
CSVFastHeaderAndTypeAnalyzer { public List<Pair<String, Type>> getHeaders() { if (!analysisPerformed) { analyze(); } return headers; } }
CSVFastHeaderAndTypeAnalyzer { public List<Pair<String, Type>> getHeaders() { if (!analysisPerformed) { analyze(); } return headers; } CSVFastHeaderAndTypeAnalyzer(List<String> sampleLines, Separator separator); }
CSVFastHeaderAndTypeAnalyzer { public List<Pair<String, Type>> getHeaders() { if (!analysisPerformed) { analyze(); } return headers; } CSVFastHeaderAndTypeAnalyzer(List<String> sampleLines, Separator separator); void analyze(); boolean isFirstLineAHeader(); List<Pair<String, Type>> getHeaders(); boolean isHeaderInfoReliable(); }
CSVFastHeaderAndTypeAnalyzer { public List<Pair<String, Type>> getHeaders() { if (!analysisPerformed) { analyze(); } return headers; } CSVFastHeaderAndTypeAnalyzer(List<String> sampleLines, Separator separator); void analyze(); boolean isFirstLineAHeader(); List<Pair<String, Type>> getHeaders(); boolean isHeaderInfoReliable();  }