On Thu, Jan 16, 2014 at 7:49 AM, Emmanuel Bourg <ebo...@apache.org> wrote:

> Le 15/01/2014 14:04, Gary Gregory a écrit :
>
> > Uh, I want to go the other way around. See my use case.
>
> Why isn't this suitable to your use case? You could write:
>
>    factory.create(record.toMap());
>
> and then remove the create(CSVRecord) method with the duplicated
> implementation.
>
> What am I missing?
>

That would work. What is still not clean or OO is that toMap() means
nothing when no headers are defined.

I've split the record into a mapped record subclass here:

https://issues.apache.org/jira/browse/CSV-104

Thoughts?

We can still have toMap() implemented on top of the code now, but it would
have to return null if there are no headers.

Gary


>
> Emmanuel Bourg
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
> For additional commands, e-mail: dev-h...@commons.apache.org
>
>


-- 
E-Mail: garydgreg...@gmail.com | ggreg...@apache.org
Java Persistence with Hibernate, Second Edition<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Reply via email to