CSV-215 CSV Record mutability#21
Conversation
|
I do not like the mutability toggle. Our options, I think are:
and document that the CSVRecord class is now mutable. This is the simplest solution. Alternatively, if we are hard core about maintaining CSVRecord as immutable, we can talk about that. BUT, note that the fact that the current implementation is immutable is NOT documented, all we say in the CSVRecord Javadoc is: "A CSV record parsed from a CSV file." |
|
The toggle was just an option to keep immutability in some sense. But Making it mutable and documenting it looks better. Wan't another pull request ? |
|
Up to you. I do not think we've reached any kind of consensus on the dev ML though. |
|
I'll wait then. |
|
Personally I don't like the "mutability" toggle and would prefer to have a setter - basically I see two options to implement the setter
|
|
Hi @nmahendru and all, Starting in version 1.10.0, you can use the method Therefore, I think this PR can be closed. |
|
Closing: The use case "to read a csv, mangle some columns, write back a new csv" is handled starting in 1.10 with the method |
I want to push another change which I feel will also be useful for the community. I want to add a CSVRecordMutable class which had a constructor which accepts a CSVRecord object. So when we have a CSVRecordMutable object from it then we can edit individual columns using it.
I would be using this to write back my edited CSV file. My use case is to read a csv, mangle some columns, write back a new csv.