Package io.ultreia.java4all.util.io
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 Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidwrite(O model, String comment, BufferedWriter writer)Write model into the givenwriter.default voidwrite(O model, String comment, Path path, Charset encoding)Write model to the givenpath.-
Methods inherited from interface io.ultreia.java4all.util.io.ConfigFormat
getFilename, getFormat
-
-
-
-
Method Detail
-
write
default void write(O model, String comment, Path path, Charset encoding) throws WriterException
Write model to the givenpath.- Parameters:
model- model to storecomment- optional commentpath- location of config to writeencoding- 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 givenwriter.- Parameters:
model- model to storecomment- optional comment to writewriter- where to write- Throws:
Exception- if any error while writing
-
-