T
- Type of the bean to be iterated overpublic class IterableCSVToBeanBuilder<T> extends Object
IterableCSVToBean bean =
new IterableCSVToBean()
.withReader(csvReader)
.withMapper(mappingStrategy)
.withFilter(csvToBeanFilter)
.build();
IterableCSVToBean
Modifier and Type | Field and Description |
---|---|
static String |
NO_MAPPING_STRATEGY_DEFINED |
static String |
NO_READER_DEFINED |
Constructor and Description |
---|
IterableCSVToBeanBuilder()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
IterableCSVToBean<T> |
build()
Creates the IterableCSVToBean.
|
protected CSVReader |
getCsvReader()
Used by unit tests.
|
protected Object |
getFilter()
Used by unit tests.
|
protected MappingStrategy |
getStrategy()
Used by unit tests.
|
IterableCSVToBeanBuilder<T> |
withFilter(CsvToBeanFilter filter)
Sets the filter used to remove unwanted data from the CSV file.
|
IterableCSVToBeanBuilder<T> |
withMapper(MappingStrategy<T> mappingStrategy)
Sets the MappingStrategy to be used by the builder.
|
IterableCSVToBeanBuilder<T> |
withReader(CSVReader reader)
Sets the reader to be used by the builder.
|
public static final String NO_MAPPING_STRATEGY_DEFINED
public static final String NO_READER_DEFINED
public IterableCSVToBean<T> build()
public IterableCSVToBeanBuilder<T> withMapper(MappingStrategy<T> mappingStrategy)
mappingStrategy
- An object that implements
MappingStrategy
public IterableCSVToBeanBuilder<T> withReader(CSVReader reader)
reader
- CSVReader to be incorporated in the builder.protected MappingStrategy getStrategy()
protected CSVReader getCsvReader()
protected Object getFilter()
public IterableCSVToBeanBuilder<T> withFilter(CsvToBeanFilter filter)
filter
- An object implementing CsvToBeanFilterCopyright © 2017. All rights reserved.