1 23 24 package com.sun.gjc.spi; 25 26 32 public class ConnectionRequestInfo implements javax.resource.spi.ConnectionRequestInfo { 33 34 private String user; 35 private String password; 36 37 43 public ConnectionRequestInfo(String user, String password) { 44 this.user = user; 45 this.password = password; 46 } 47 48 53 public String getUser() { 54 return user; 55 } 56 57 62 public String getPassword() { 63 return password; 64 } 65 66 71 public boolean equals(Object obj) { 72 if (obj == null) return false; 73 if (obj instanceof ConnectionRequestInfo) { 74 ConnectionRequestInfo other = (ConnectionRequestInfo) obj; 75 return (isEqual(this.user, other.user) && 76 isEqual(this.password, other.password)); 77 } else { 78 return false; 79 } 80 } 81 82 87 public int hashCode() { 88 String result = "" + user + password; 89 return result.hashCode(); 90 } 91 92 98 private boolean isEqual(Object o1, Object o2) { 99 if (o1 == null) { 100 return (o2 == null); 101 } else { 102 return o1.equals(o2); 103 } 104 } 105 106 } | Popular Tags |