Class CsvWriter.CsvWriterRecord

java.lang.Object
de.siegmar.fastcsv.writer.CsvWriter.CsvWriterRecord
Enclosing class:
CsvWriter

public final class CsvWriter.CsvWriterRecord extends Object

This class is used to write a record field by field.

Obtain an instance via CsvWriter.writeRecord() (no-arg), write fields with writeField(String), and complete the record with endRecord().

Example use:

csv.writeRecord()
    .writeField("field1")
    .writeField("field2")
    .endRecord();

This class is not thread-safe.

  • Method Details

    • writeField

      public CsvWriter.CsvWriterRecord writeField(String value)
      Writes a field to the current record.
      Parameters:
      value - the field value
      Returns:
      this CsvWriterRecord instance
      Throws:
      UncheckedIOException - if a write-error occurs
    • endRecord

      public CsvWriter endRecord()
      Ends the current record.
      Returns:
      the enclosing CsvWriter instance
      Throws:
      UncheckedIOException - if a write-error occurs