obis-spd-plugin/src/main/java/org/gcube/data/spd/obisplugin/pool/DatabaseCredential.java

91 lines
1.6 KiB
Java

/**
*
*/
package org.gcube.data.spd.obisplugin.pool;
/**
* @author "Federico De Faveri defaveri@isti.cnr.it"
*
*/
public class DatabaseCredential {
protected String url;
protected String user;
protected String password;
/**
* @param url
* @param user
* @param password
*/
public DatabaseCredential(String url, String user, String password) {
this.url = url;
this.user = user;
this.password = password;
}
/**
* @return the url
*/
public String getUrl() {
return url;
}
/**
* @return the user
*/
public String getUser() {
return user;
}
/**
* @return the password
*/
public String getPassword() {
return password;
}
/**
* {@inheritDoc}
*/
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((password == null) ? 0 : password.hashCode());
result = prime * result + ((url == null) ? 0 : url.hashCode());
result = prime * result + ((user == null) ? 0 : user.hashCode());
return result;
}
/**
* {@inheritDoc}
*/
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
DatabaseCredential other = (DatabaseCredential) obj;
if (password == null) {
if (other.password != null)
return false;
} else if (!password.equals(other.password))
return false;
if (url == null) {
if (other.url != null)
return false;
} else if (!url.equals(other.url))
return false;
if (user == null) {
if (other.user != null)
return false;
} else if (!user.equals(other.user))
return false;
return true;
}
}