com.comtrade.ecm.engine.io

## Class BufferedWriterBuilder

- java.lang.Object
- - com.comtrade.ecm.engine.io.BufferedWriterBuilder

-     public class BufferedWriterBuilder
      extends java.lang.Object

  `BufferedWriter` builder
  If a `BufferedWriter` is created without explicitely stating a `Charset` it uses, it will use `StandardCharsets.UTF_8`. If a `BufferedWriter` is created without explicitely stating an `OpenOption` it uses, a new file will be created. It is mandatory to state a `path`-parameter.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BufferedWriterBuilder()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.io.BufferedWriter` | `build()` Creates a `BufferedWriter`, according to previously set parameters.
    `BufferedWriterBuilder` | `withCharset(java.nio.charset.Charset charset)` `Charset` to be used while writing to a file. This parameter is optional. If not stated, a `DEFAULT_CHARSET` will be used.
    `BufferedWriterBuilder` | `withCharset(java.lang.String charset)` `Charset` to be used while writing to a file. This parameter is optional. If not stated, a `DEFAULT_CHARSET` will be used.
    `BufferedWriterBuilder` | `withOption(java.nio.file.OpenOption option)` Sets an `OpenOption` to be used when opening/creating a file. This parameter can be used multiple times.
    `BufferedWriterBuilder` | `withPath(java.nio.file.Path path)`
    `BufferedWriterBuilder` | `withPath(java.lang.String path)`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### BufferedWriterBuilder

          public BufferedWriterBuilder()

  - ### Method Detail

    - #### withPath

          public BufferedWriterBuilder withPath(java.nio.file.Path path)

      Parameters:
        `path` - `Path` of a file that shoud be written into
      Returns:
        A `BufferedWriterBuilder` object

    - #### withPath

          public BufferedWriterBuilder withPath(java.lang.String path)

      Parameters:
        `path` - `Path` of a file that shoud be written into
      Returns:
        A `BufferedWriterBuilder` object

    - #### withCharset

          public BufferedWriterBuilder withCharset(java.nio.charset.Charset charset)

      `Charset` to be used while writing to a file.
      This parameter is optional.
      If not stated, a `DEFAULT_CHARSET` will be used.
      Parameters:
        `charset` - `Charset` to be used while writing to a file
      Returns:
        A `BufferedWriterBuilder` object

    - #### withCharset

          public BufferedWriterBuilder withCharset(java.lang.String charset)

      `Charset` to be used while writing to a file.
      This parameter is optional.
      If not stated, a `DEFAULT_CHARSET` will be used.
      Parameters:
        `charset` - `Charset` to be used while writing to a file
      Returns:
        A `BufferedWriterBuilder` object

    - #### withOption

          public BufferedWriterBuilder withOption(java.nio.file.OpenOption option)

      Sets an `OpenOption` to be used when opening/creating a file.
      This parameter can be used multiple times. All of the set options will be used when opening/creating a file.
      Parameters:
        `option` - Configuration parameter that states how to open or create a file
      Returns:
        A `BufferedWriterBuilder` object

    - #### build

          public java.io.BufferedWriter build()
                                       throws java.io.IOException

      Creates a `BufferedWriter`, according to previously set parameters.
      Returns:
        Newly created `BufferedWriter`
      Throws:
        `java.lang.IllegalArgumentException` - If parameter `path` is not properly set.
        `java.io.IOException` - If something prevents normal opening/creation of a file.