1 30 31 32 package org.hsqldb.util; 33 34 40 public class ConnectionSetting implements java.io.Serializable { 41 42 private String name, driver, url, user, pw; 43 44 String getName() { 45 return name; 46 } 47 48 String getDriver() { 49 return driver; 50 } 51 52 String getUrl() { 53 return url; 54 } 55 56 String getUser() { 57 return user; 58 } 59 60 String getPassword() { 61 return pw; 62 } 63 64 private ConnectionSetting() {} 66 ; 67 68 ConnectionSetting(String name, String driver, String url, String user, 69 String pw) { 70 71 this.name = name; 72 this.driver = driver; 73 this.url = url; 74 this.user = user; 75 this.pw = pw; 76 } 77 78 public boolean equals(Object obj) { 79 80 if (!(obj instanceof ConnectionSetting)) { 81 return false; 82 } 83 84 ConnectionSetting other = (ConnectionSetting) obj; 85 86 if (getName() == other.getName()) { 87 return true; 88 } 89 90 if (getName() == null) { 91 return false; 92 } 93 94 return getName().trim().equals(other.getName().trim()); 95 } 96 97 public int hashCode() { 98 return getName() == null ? 0 99 : getName().trim().hashCode(); 100 } 101 } 102 | Popular Tags |