FasterXML / FasterXML/jackson-dataformats-text

`MappingIterator` returns `List` or `Map` depending on `CSVSchema.withHeader()`

Offen
#88 4 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
csv
Vorherrschende Sprache
Java
Sterne
455
Forks
164
Ø Merge
6 T. 10 Std.
Gemergte PRs (30 T.)
2

Beschreibung

If CSVSchema.withHeader == true i must do:

` final Map line = (Map) mappingIterator.nextValue();`

If CSVSchema.withHeader == false i must do:

` final List line = (List) mappingIterator.nextValue();`

My use-case is: I have only one Class in which i parse CSV and this class can be configured to read the csv with header or without header (boolean-flag). For me it would be better if the MappingIterator always returns the same result-type (either a list or a map). Its not necessary, but would make things easier for me because now i need to cast the type like above, which looks a bit unsafe and is marked as yellow-warning in Eclipse-IDE.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.