Class IntermediateTxtFileWriterPipe<T>

  • All Implemented Interfaces:
    Closeable, AutoCloseable, BasePipe, Pipe<T>

    public class IntermediateTxtFileWriterPipe<T>
    extends DelegatePipe<T>
    A pipe write to a text file any item passed through it. The write callback is never invoked on null values which indicate end of input pipe. Pipe output is same as pipe input. In order to write the object as a string, a string mapper must be provided.
    Author:
    Shai Barad
    • Constructor Detail

      • IntermediateTxtFileWriterPipe

        public IntermediateTxtFileWriterPipe​(Pipe<T> input,
                                             File output,
                                             Charset charset,
                                             FileWriteOptions options,
                                             FailableFunction<T,​String,​PipeException> stringMapper)
        Constructor
        Parameters:
        input - The input pipe
        output - The text file to write to. If exists, the file is being overwritten.
        charset - the file charset
        options - the file options
        stringMapper - in order to write the object as a string, a string mapper must be provided
      • IntermediateTxtFileWriterPipe

        public IntermediateTxtFileWriterPipe​(Pipe<T> input,
                                             File output,
                                             Charset charset,
                                             FileWriteOptions options)
        Constructor Uses the toString as the mapper from the object to String
        Parameters:
        input - The input pipe
        output - The text file to write to. If exists, the file is being overwritten.
        charset - the file charset
        options - the file options
      • IntermediateTxtFileWriterPipe

        public IntermediateTxtFileWriterPipe​(Pipe<T> input,
                                             File output,
                                             Charset charset,
                                             FailableFunction<T,​String,​PipeException> stringMapper)
        Constructor Uses default file write options.
        Parameters:
        input - The input pipe
        output - The text file to write to. If exists, the file is being overwritten.
        charset - the file charset
        stringMapper - in order to write the object as a string, a string mapper must be provided. It should never return null values
      • IntermediateTxtFileWriterPipe

        public IntermediateTxtFileWriterPipe​(Pipe<T> input,
                                             File output,
                                             FailableFunction<T,​String,​PipeException> stringMapper)
        Constructor Uses default file write options and UTF8.
        Parameters:
        input - The input pipe
        output - The text file to write to. If exists, the file is being overwritten.
        stringMapper - in order to write the object as a string, a string mapper must be provided. It should never return null values
      • IntermediateTxtFileWriterPipe

        public IntermediateTxtFileWriterPipe​(Pipe<T> input,
                                             File output,
                                             FileWriteOptions options)
        Constructor Uses default toString() as the string mapper, and UTF8
        Parameters:
        input - The input pipe
        output - The text file to write to. If exists, the file is being overwritten.
        options - the file options
      • IntermediateTxtFileWriterPipe

        public IntermediateTxtFileWriterPipe​(Pipe<T> input,
                                             File output,
                                             FileWriteOptions options,
                                             FailableFunction<T,​String,​PipeException> stringMapper)
        Constructor Uses UTF8
        Parameters:
        input - The input pipe
        output - The text file to write to. If exists, the file is being overwritten.
        options - The file writing options
        stringMapper - in order to write the object as a string, a string mapper must be provided. It should never return null values