Class FileWriterWithEncoding.Builder

    • Field Detail

      • append

        private boolean append
      • charsetEncoder

        private java.nio.charset.CharsetEncoder charsetEncoder
    • Method Detail

      • get

        public FileWriterWithEncoding get()
                                   throws java.io.IOException
        Builds a new FileWriterWithEncoding.

        You must set an aspect that supports File on this builder, otherwise, this method throws an exception.

        This builder uses the following aspects:

        • File is the target aspect.
        • CharsetEncoder
        • append
        Returns:
        a new instance.
        Throws:
        java.lang.UnsupportedOperationException - if the origin cannot provide a File.
        java.lang.IllegalStateException - if the origin is null.
        java.io.IOException - if an I/O error occurs converting to an File using AbstractStreamBuilder.getFile().
        See Also:
        AbstractOrigin.getFile(), IOSupplier.getUnchecked()
      • setAppend

        public FileWriterWithEncoding.Builder setAppend​(boolean append)
        Sets whether or not to append.
        Parameters:
        append - Whether or not to append.
        Returns:
        this instance.
      • setCharsetEncoder

        public FileWriterWithEncoding.Builder setCharsetEncoder​(java.nio.charset.CharsetEncoder charsetEncoder)
        Sets charsetEncoder to use for encoding.
        Parameters:
        charsetEncoder - The charsetEncoder to use for encoding.
        Returns:
        this instance.