com.smallaswater.easysql.mysql.utils.LoginPool 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.utils;
import com.alibaba.druid.pool.DruidDataSource;
import com.smallaswater.easysql.v3.mysql.BaseMySql;
/**
* @author SmallasWater
* Create on 2021/7/4 9:08
* Package com.smallaswater.easysql
*/
public class LoginPool {
public DruidDataSource dataSource = new DruidDataSource();
private final String user;
private final String ip;
private final String database;
private BaseMySql manager;
public LoginPool(String ip, String user, String database) {
this.ip = ip;
this.user = user;
this.database = database;
}
public void setManager(BaseMySql manager) {
this.manager = manager;
}
public BaseMySql getManager() {
return manager;
}
@Override
public boolean equals(Object pool) {
if (pool instanceof LoginPool) {
return ((LoginPool) pool).database.equalsIgnoreCase(database) &&
((LoginPool) pool).user.equalsIgnoreCase(user) &&
((LoginPool) pool).ip.equalsIgnoreCase(ip);
}
return false;
}
}