Interface WriterContract<O>

  • Type Parameters:
    O - type of object
    All Superinterfaces:
    ConfigFormat
    All Known Subinterfaces:
    StorageContract<O>

    public interface WriterContract<O>
    extends ConfigFormat
    Created on 10/12/2021.
    Since:
    1.0.16
    Author:
    Tony Chemit - dev@tchemit.fr
    • Method Detail

      • write

        default void write​(O model,
                           String comment,
                           Path path,
                           Charset encoding)
                    throws WriterException
        Write model to the given path.
        Parameters:
        model - model to store
        comment - optional comment
        path - location of config to write
        encoding - encoding of writer
        Throws:
        WriterException - if error while reading config
      • write

        void write​(O model,
                   String comment,
                   BufferedWriter writer)
            throws Exception
        Write model into the given writer.
        Parameters:
        model - model to store
        comment - optional comment to write
        writer - where to write
        Throws:
        Exception - if any error while writing