1 28 29 package com.caucho.sql; 30 31 import javax.resource.spi.ConnectionRequestInfo ; 32 33 36 public class Credential implements ConnectionRequestInfo { 37 private String _userName; 38 private String _password; 39 40 Credential(String userName, String password) 41 { 42 _userName = userName; 43 _password = password; 44 } 45 46 49 public String getUserName() 50 { 51 return _userName; 52 } 53 54 57 public String getPassword() 58 { 59 return _password; 60 } 61 62 65 public int hashCode() 66 { 67 return getUserName().hashCode() * 65521 + getPassword().hashCode(); 68 } 69 70 73 public boolean equals(Object o) 74 { 75 if (! (o instanceof Credential)) 76 return false; 77 78 Credential credential = (Credential) o; 79 80 return (getUserName().equals(credential.getUserName()) && 81 getPassword().equals(credential.getPassword())); 82 } 83 } 84 85 | Popular Tags |