FasterXML / FasterXML/jackson-dataformats-text

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

Open
#88 4 comments 0 reactions 0 assignees View on GitHub
csv
Dominant language
Java
Stars
455
Forks
164
Avg merge
6d 10h
Merged PRs (30d)
2

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.