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 aStringWriterby calling itstoStringmethod.- Author:
- Mahmoud Ben Hassine (mahmoud.benhassine@icloud.com)
-
-
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 voidclose()Close the writervoidwriteRecords(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:RecordWriterWrite a batch of records to a data sink.- Specified by:
writeRecordsin interfaceRecordWriter<P>- Parameters:
batch- of records to write.
-
close
public void close() throws java.lang.ExceptionDescription copied from interface:RecordWriterClose the writer- Specified by:
closein interfaceRecordWriter<P>- Throws:
java.lang.Exception- if an error occurs during closing the writer
-
-