Package io.ultreia.java4all.util.io
Interface StorageContract<O>
-
- Type Parameters:
O- type of object
- All Superinterfaces:
ConfigFormat,ReaderContract<O>,WriterContract<O>
public interface StorageContract<O> extends ReaderContract<O>, WriterContract<O>
Created on 10/12/2021.- Since:
- 1.0.16
- Author:
- Tony Chemit - dev@tchemit.fr
-
-
Method Summary
Static Methods Modifier and Type Method Description static <O> Oget(Map<String,O> cache, String format)Get object for the givenformat.static <O,C extends StorageContract<O>>
SingletonSupplier<Map<String,C>>load(Class<C> type)static <O,C extends StorageContract<O>>
SingletonSupplier<Map<String,C>>load(ClassLoader classLoader, Class<C> type)-
Methods inherited from interface io.ultreia.java4all.util.io.ConfigFormat
getFilename, getFormat
-
Methods inherited from interface io.ultreia.java4all.util.io.ReaderContract
read, read, read
-
Methods inherited from interface io.ultreia.java4all.util.io.WriterContract
write, write
-
-
-
-
Method Detail
-
get
static <O> O get(Map<String,O> cache, String format)
Get object for the givenformat.- Type Parameters:
O- type of object- Parameters:
format- format of object to getcache- cache of objects- Returns:
- the found object
- Throws:
IllegalArgumentException- if no object found for the given formatNullPointerException- if format is null
-
load
static <O,C extends StorageContract<O>> SingletonSupplier<Map<String,C>> load(Class<C> type)
-
load
static <O,C extends StorageContract<O>> SingletonSupplier<Map<String,C>> load(ClassLoader classLoader, Class<C> type)
-
-