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

com.smallaswater.easysql.mysql.manager.PluginManager Maven / Gradle / Ivy

There is a newer version: 3.0.7
Show newest version
package com.smallaswater.easysql.mysql.manager;


import cn.nukkit.plugin.Plugin;
import com.smallaswater.easysql.mysql.BaseMySql;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

/**
 * 缓存 数据库对象
 *
 * @author 若水
 */
public class PluginManager {
    private static final HashMap CONNECTION = new HashMap<>();


    public PluginManager() {
    }

    public static BaseMySql getData(Plugin plugin) {
        return CONNECTION.get(plugin);
    }

    public static List getList() {
        return new ArrayList<>(CONNECTION.values());
    }

    public static void connect(Plugin plugin, BaseMySql baseMySql) {
        CONNECTION.put(plugin, baseMySql);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy