Interface RecordWriter<T>

    • Method Detail

      • parseHeader

        void parseHeader​(String... aHeader)
        Parses and sets the Header from the provided String. You must have provided a ColumnFactory for this operation to succeed.
        Parameters:
        aHeader - The header to be created.
      • writeHeader

        void writeHeader​(String... aHeader)
        Parses and sets the Header from the provided String arguments and writes the CSV header to the writer (be it a Stream or a File). You must have provided a ColumnFactory for this operation to succeed.
        Parameters:
        aHeader - The header to be created.
      • writeHeader

        void writeHeader​(Header<T> aHeader)
        Sets and writes the provided Header to the writer (be it a Stream or a File). .
        Parameters:
        aHeader - The header to be created.
      • writeHeader

        void writeHeader()
        Writes the CSV header to the writer (be it a Stream or a File). You must have provided a Header for this operation to succeed.
      • writeNext

        void writeNext​(T... aRecord)
                throws IllegalArgumentException
        Directly logs the provided instances to the writer.
        Specified by:
        writeNext in interface org.refcodes.io.RowWriter<T>
        Parameters:
        aRecord - The instances to be logged.
        Throws:
        IllegalArgumentException - thrown in case the provided objects do not align with the header (as of HeaderAccessor.getHeader()).
      • writeNextType

        default <TYPE> void writeNextType​(TYPE aRecord)
                                   throws IllegalArgumentException
        Directly logs the provided instance to the writer. The properties of the given type matching the header are written accordingly.
        Type Parameters:
        TYPE - the generic type
        Parameters:
        aRecord - The instance to be logged.
        Throws:
        IllegalArgumentException - thrown in case the provided objects do not align with the header (as of HeaderAccessor.getHeader()).