1 package org.myoodb.core; 25 26 public final class User implements java.io.Serializable 27 { 28 private String m_name; 29 private String m_password; 30 31 public User() 32 { 33 } 34 35 public User(String name, String password) 36 { 37 m_name = name; 38 m_password = password; 39 } 40 41 public String getName() 42 { 43 return m_name; 44 } 45 46 public String getPassword() 47 { 48 return m_password; 49 } 50 51 public void setPassword(String password) 52 { 53 m_password = password; 54 } 55 56 public int hashCode() 57 { 58 return m_name.hashCode(); 59 } 60 61 public boolean equals(Object obj) 62 { 63 if (this == obj) 64 { 65 return true; 66 } 67 else if (obj instanceof User) 68 { 69 return m_name.equals(((User)obj).m_name); 70 } 71 else 72 { 73 return false; 74 } 75 } 76 77 public String toString() 78 { 79 return "User: " + m_name; 80 } 81 } 82 | Popular Tags |