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 anIterable
data source. This reader producesGenericRecord
instances containing original objects from the data source.- Author:
- Mahmoud Ben Hassine ([email protected])
-
-
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 void
open()
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:RecordReader
Open the reader.- Specified by:
open
in interfaceRecordReader<P>
-
readRecord
public GenericRecord<P> readRecord()
Description copied from interface:RecordReader
Read next record from the data source.- Specified by:
readRecord
in interfaceRecordReader<P>
- Returns:
- the next record from the data source or
null
if the end of the data source is reached
-
-