package org.adrianvictor.lib.configuration.provider;

import org.adrianvictor.lib.configuration.exception.InvalidConfigurationException;

import java.io.File;
import java.io.IOException;
import java.io.Reader;
import java.util.List;
import java.util.Map;

public interface ConfigurationProvider {
    void load(File file) throws IOException, InvalidConfigurationException;
    void load(String contents) throws IOException, InvalidConfigurationException;
    void load(Reader reader) throws IOException, InvalidConfigurationException;
    boolean save(File file);
    boolean save();
    String saveToString();
    Object getProperty(String path);
    void setProperty(String path, Object value);
    Map<String, Object> getAll();
    boolean getBoolean(String path, boolean def);
    List<Boolean> getBooleanList(String path, List<Boolean> def);
    double getDouble(String path, double def);
    List<Double> getDoubleList(String path, List<Double> def);
    int getInt(String path, int def);
    String getString(String path);
    String getString(String path, String def);
    List<String> getStringList(String path, List<String> def);
    List<Integer> getIntList(String path, List<Integer> def);
    List<String> getKeys(String path);
    List<String> getKeys();
    List<Object> getList(String path);
}