All Downloads are FREE. Search and download functionalities are using the official Maven repository.

studio.wetrack.docgen.markdown.kancloud.Config Maven / Gradle / Ivy

package studio.wetrack.docgen.markdown.kancloud;

import studio.wetrack.base.utils.jackson.Jackson;

import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by zhanghong on 17/3/24.
 */
public class Config {

    List plugins;
    Map pluginsConfig;


    public static Config DefaultApiConfig(String apiHost, Map headers){
        Config config = new Config();
        config.setPlugins(Arrays.asList("api", "highlight"));

        config.pluginsConfig = new HashMap<>();

        Map apiConfig = new HashMap<>();
        apiConfig.put("url", apiHost);
        apiConfig.put("headers", headers);
        apiConfig.put("explore", true);
        config.pluginsConfig.put("api", apiConfig);

        return config;
    }

    public List getPlugins() {
        return plugins;
    }

    public void setPlugins(List plugins) {
        this.plugins = plugins;
    }

    public Map getPluginsConfig() {
        return pluginsConfig;
    }

    public void setPluginsConfig(Map pluginsConfig) {
        this.pluginsConfig = pluginsConfig;
    }

    public String toJson(){
        return Jackson.base().writeValueAsString(this);
    }

    public static void main(String[] args){
        System.out.println(Config.DefaultApiConfig("", null).toJson());
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy