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

com.smallaswater.easysql.mysql.utils.LoginPool Maven / Gradle / Ivy

There is a newer version: 3.0.7
Show newest version
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;
    }


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy