Package org.jeasy.batch.core.writer
Class StringRecordWriter<P>
- java.lang.Object
-
- org.jeasy.batch.core.writer.StringRecordWriter<P>
-
- Type Parameters:
P
- type of the record's payload
- All Implemented Interfaces:
RecordWriter<P>
public class StringRecordWriter<P> extends java.lang.Object implements RecordWriter<P>
Writes the payload of record to aStringWriter
by calling itstoString
method.- Author:
- Mahmoud Ben Hassine ([email protected])
-
-
Constructor Summary
Constructors Constructor Description StringRecordWriter(java.io.StringWriter stringWriter)
Create a newStringWriter
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Close the writervoid
writeRecords(Batch<P> batch)
Write a batch of records to a data sink.-
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.writer.RecordWriter
open
-
-
-
-
Method Detail
-
writeRecords
public void writeRecords(Batch<P> batch)
Description copied from interface:RecordWriter
Write a batch of records to a data sink.- Specified by:
writeRecords
in interfaceRecordWriter<P>
- Parameters:
batch
- of records to write.
-
close
public void close() throws java.lang.Exception
Description copied from interface:RecordWriter
Close the writer- Specified by:
close
in interfaceRecordWriter<P>
- Throws:
java.lang.Exception
- if an error occurs during closing the writer
-
-