1 24 25 package org.objectweb.cjdbc.driver; 26 27 import java.io.Serializable ; 28 29 37 public class DatabaseUser implements Serializable 38 { 39 private static final long serialVersionUID = 4733183236454586066L; 40 41 42 private String dbName; 43 44 45 private String login; 46 47 48 private String password; 49 50 57 public DatabaseUser(String dbName, String login, String password) 58 { 59 this.dbName = dbName; 60 this.login = login; 61 this.password = password; 62 } 63 64 74 public boolean matches(String dbName, String login, String password) 75 { 76 return (this.dbName.equals(dbName) && this.login.equals(login) && this.password 77 .equals(password)); 78 } 79 80 87 public boolean equals(Object other) 88 { 89 if (!(other instanceof DatabaseUser)) 90 return false; 91 92 DatabaseUser castOther = (DatabaseUser) other; 93 return matches(castOther.dbName, castOther.login, castOther.password); 94 } 95 96 101 public String getDbName() 102 { 103 return dbName; 104 } 105 106 111 public String getLogin() 112 { 113 return login; 114 } 115 116 121 public String getPassword() 122 { 123 return password; 124 } 125 } 126 | Popular Tags |