Package org.jeasy.batch.core.reader
Class IterableRecordReader<P>
- java.lang.Object
-
- org.jeasy.batch.core.reader.IterableRecordReader<P>
-
- Type Parameters:
P- type of the record's payload
- All Implemented Interfaces:
RecordReader<P>
public class IterableRecordReader<P> extends java.lang.Object implements RecordReader<P>
Reads record from anIterabledata source. This reader producesGenericRecordinstances containing original objects from the data source.- Author:
- Mahmoud Ben Hassine (mahmoud.benhassine@icloud.com)
-
-
Constructor Summary
Constructors Constructor Description IterableRecordReader(java.lang.Iterable<P> dataSource)Create a newIterableRecordReader.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidopen()Open the reader.GenericRecord<P>readRecord()Read next record from the data source.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jeasy.batch.core.reader.RecordReader
close
-
-
-
-
Constructor Detail
-
IterableRecordReader
public IterableRecordReader(java.lang.Iterable<P> dataSource)
Create a newIterableRecordReader.- Parameters:
dataSource- to read records from.
-
-
Method Detail
-
open
public void open()
Description copied from interface:RecordReaderOpen the reader.- Specified by:
openin interfaceRecordReader<P>
-
readRecord
public GenericRecord<P> readRecord()
Description copied from interface:RecordReaderRead next record from the data source.- Specified by:
readRecordin interfaceRecordReader<P>- Returns:
- the next record from the data source or
nullif the end of the data source is reached
-
-