com.smallaswater.easysql.mysql.manager.PluginManager Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of EasyMySQL Show documentation
Show all versions of EasyMySQL Show documentation
EasyMySQL -- MySQL tool for Nukkit
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);
}
}