Interface ReaderContract<O>

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

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

      • read

        default O read​(Path path)
                throws ReaderException
        Read from given path.
        Parameters:
        path - location of object to read
        Returns:
        loaded object
        Throws:
        ReaderException - if error while reading
      • read

        default O read​(URL url,
                       Charset encoding)
                throws ReaderException
        Read from given url.
        Parameters:
        url - url where to read
        encoding - encoding used to read storage
        Returns:
        loaded object
        Throws:
        ReaderException - if any read error
      • read

        O read​(Reader reader,
               String fileName)
        throws Exception
        Read from given reader.
        Parameters:
        reader - where to read
        fileName - file name of config
        Returns:
        loaded object
        Throws:
        Exception - if any error while reading