Package io.ultreia.java4all.util.io
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 Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Oread(Reader reader, String fileName)Read from given reader.default Oread(URL url, Charset encoding)Read from givenurl.default Oread(Path path)Read from givenpath.-
Methods inherited from interface io.ultreia.java4all.util.io.ConfigFormat
getFilename, getFormat
-
-
-
-
Method Detail
-
read
default O read(Path path) throws ReaderException
Read from givenpath.- 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 givenurl.- Parameters:
url- url where to readencoding- encoding used to read storage- Returns:
- loaded object
- Throws:
ReaderException- if any read error
-
-