Generic loader interface for loading/saving plugin objects out of YAML configuration files. @param Type of object handled by this loader.
| 12 | * @param <T> Type of object handled by this loader. |
| 13 | */ |
| 14 | public interface Loader<T> { |
| 15 | |
| 16 | /** |
| 17 | * Loads an object from a YAML configuration. |
| 18 | * |
| 19 | * @param configuration The YAML configuration to load the object from. |
| 20 | * @param path The path within the configuration to locate the object. |
| 21 | * @param objects Additional parameters that might be needed for loading. |
| 22 | * @return The loaded object. |
| 23 | * @throws InventoryException If there is an error while loading the object. |
| 24 | */ |
| 25 | T load(@NotNull YamlConfiguration configuration, @NotNull String path, Object... objects) throws InventoryException; |
| 26 | |
| 27 | /** |
| 28 | * Saves an object to a YAML configuration. |
| 29 | * |
| 30 | * @param object The object to be saved. |
| 31 | * @param configuration The YAML configuration to save the object to. |
| 32 | * @param path The path within the configuration where the object should be saved. |
| 33 | * @param file The file where the configuration is stored. |
| 34 | * @param objects Additional parameters that might be needed for saving. |
| 35 | */ |
| 36 | void save(T object,@NotNull YamlConfiguration configuration,@NotNull String path, File file, Object... objects); |
| 37 | |
| 38 | } |
no outgoing calls
no test coverage detected