package pt.iscte.ci.aop.pooling; /** * * This code has been adapted from the book AspectJ in Action. * * @author Paulo Zenida * */ public class DBConnectionDescription { private String url; private String username; private String password; public DBConnectionDescription(final String url, final String username, final String password) { this.url = url; this.username = username; this.password = password; } @Override public int hashCode() { return url.hashCode(); } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!obj.getClass().equals(getClass())) { return false; } final DBConnectionDescription desc = (DBConnectionDescription) obj; return (url == null ? desc.url == null : url.equals(desc.url)) && (username == null ? desc.username == null : username.equals(desc.username)) && (password == null ? desc.password == null : password.equals(desc.password)); } }