commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Gregory <>
Subject Re: [csv] CSVRecord implements Map<String, String>
Date Tue, 14 Jan 2014 23:29:20 GMT
I have a complex immutable class with a constructor that takes many fields.

I have a factory that builds instances of this class.

At runtime, some of the data to build the objects come from CSVRecord

At other times, like for tests, I want build sometimes I build the objects
from CSVRecord and sometimes from Map objects. The factory uses the Map
like a CSVRecord. This let's me build simple, medium and large objects
using a Map, which is handy for the test, without having to deal with all
of the fields in a real record.

Right now, I have duplicate looking code in the factory methods since
CSVRecord and Map<String, String> are not friends.

Hence my request. Also consider that one cannot do 'new CSVRecord()' like
one can 'new HashMap<String, String>()'.


On Tue, Jan 14, 2014 at 6:11 PM, Emmanuel Bourg <> wrote:

> I'm not fond of the idea at the first glance. What is your use case?
> Emmanuel
> Le 14/01/2014 23:27, Gary Gregory a écrit :
> > Hi All:
> >
> > Any thoughts on making CSVRecord implement Map<String, String> ?
> >
> > It would certainly help remove duplicate code in a use case of mine.
> >
> > Gary
> >
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

E-Mail: |
Java Persistence with Hibernate, Second Edition<>
JUnit in Action, Second Edition <>
Spring Batch in Action <>

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message