1 18 package org.objectweb.speedo.jca; 19 20 import javax.resource.cci.ConnectionSpec ; 21 import javax.resource.spi.ConnectionRequestInfo ; 22 23 29 public class JDOConnectionSpec 30 implements ConnectionSpec , ConnectionRequestInfo { 31 32 public String user; 33 public String password; 34 35 public JDOConnectionSpec(String user, String password) { 36 this.user = user; 37 this.password = password; 38 } 39 40 public boolean equals(Object obj) { 41 if (!(obj instanceof JDOConnectionSpec)) { 42 return false; 43 } 44 JDOConnectionSpec jdocs = (JDOConnectionSpec) obj; 45 return 46 (user == null 47 ? jdocs.user == null 48 : user.equals(jdocs.user)) 49 && (password == null 50 ? jdocs.password == null 51 : password.equals(jdocs.password)); 52 } 53 54 public int hashCode() { 55 return toString().hashCode(); 56 } 57 58 public String toString() { 59 StringBuffer sb = new StringBuffer (); 60 sb.append("user: "); 61 sb.append(user); 62 sb.append(" / password: "); 63 sb.append(password); 64 return sb.toString(); 65 } 66 } 67 | Popular Tags |