package com.github.games647.fastlogin.core;

import java.util.Map;

public class SharedConfig {

    private final Map<String, Object> configValues;

    public SharedConfig(Map<String, Object> configValues) {
        this.configValues = configValues;
    }

    @SuppressWarnings("unchecked")
    public <T> T get(String path, T def) {
        Object val = configValues.get(path);
        return ( val != null ) ? (T) val : def;
    }

    public <T> T get(String path) {
        return get(path, null);
    }

    public Map<String, Object> getConfigValues() {
        return configValues;
    }
}

@@ -375,16 +375,109 @@
 (path);%0A
+%0A        if (def instanceof String) %7B%0A            return (T) String.valueOf(val);%0A        %7D%0A%0A
         

Convert config values to string if casting fails