jbarberan / beanio

Automatically exported from code.google.com/p/beanio
0 stars 0 forks source link

Add Enum for StreamBuilder Format-Type #132

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
While creating a StreamBuilder you have to put the format as a string:

final StreamBuilder builder = new 
StreamBuilder("Example").format("fixedlength");

What would be cleaner instead?

Add an Enum with all your supported format types, so users can just do this:

final StreamBuilder builder = new 
StreamBuilder("Example").format(StreamFormat.FixedLength);

Why?

1. I ran into an exception because I wrote "fixedLength" instead of 
"fixedlength" (misread in the documentation)
2. It is just cleaner.

What version of BeanIO are you using? What JDK version?
beanio 2.1.0
jdk 1.7

Original issue reported on code.google.com by tabb...@gmail.com on 26 Jun 2015 at 2:42