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

org.zodiac.ds.api.config.DynamicMultipleDataSourceInfo Maven / Gradle / Ivy

package org.zodiac.ds.api.config;

import java.util.Objects;

import org.zodiac.ds.api.DatabaseType;

public class DynamicMultipleDataSourceInfo {

    private boolean enabled = false;

    private DatabaseType databaseType;

    private final DataSourceSwitchStrategyInfo datasourceSwitch = new DataSourceSwitchStrategyInfo();

    private final TableSwitchStrategyInfo tableSwitch = new TableSwitchStrategyInfo();

    public DynamicMultipleDataSourceInfo() {
    }

    public boolean isEnabled() {
        return enabled;
    }

    public DynamicMultipleDataSourceInfo setEnabled(boolean enabled) {
        this.enabled = enabled;
        return this;
    }

    public DatabaseType getDatabaseType() {
        return databaseType;
    }

    public DynamicMultipleDataSourceInfo setDatabaseType(DatabaseType databaseType) {
        this.databaseType = databaseType;
        return this;
    }

    public DataSourceSwitchStrategyInfo getDatasourceSwitch() {
        return datasourceSwitch;
    }

    public TableSwitchStrategyInfo getTableSwitch() {
        return tableSwitch;
    }

    @Override
    public int hashCode() {
        return Objects.hash(datasourceSwitch, databaseType, enabled, tableSwitch);
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        DynamicMultipleDataSourceInfo other = (DynamicMultipleDataSourceInfo)obj;
        return Objects.equals(datasourceSwitch, other.datasourceSwitch) && databaseType == other.databaseType
            && enabled == other.enabled && Objects.equals(tableSwitch, other.tableSwitch);
    }

    @Override
    public String toString() {
        return "[enabled=" + enabled + ", databaseType=" + databaseType + ", dataSourceSwitch="
            + datasourceSwitch + ", tableSwitch=" + tableSwitch + "]";
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy