This avoids the duplication of the parser, which might still be generified later to support custom beans.
The example becomes:
CSVFormat format = CSVFormat.DEFAULT.withHeader();
for (CSVRecord record : format.parse(in)) {
Person person = new Person();
person.setName(record.get("name"));
person.setEmail(record.get("email"));
person.setPhone(record.get("phone"));
persons.add(person);
}
The record is not a Map to keep it simple, it only exposes 3 methods:
get(int), get(String) and size()
Emmanuel Bourg
smime.p7s
Description: S/MIME Cryptographic Signature
