1 16 package org.getahead.dwrdemo.people; 17 18 import org.directwebremoting.Security; 19 20 23 public class Person 24 { 25 28 public String getAddress() 29 { 30 return address; 31 } 32 33 36 public void setAddress(String address) 37 { 38 this.address = Security.escapeHtml(address); 39 } 40 41 44 public int getId() 45 { 46 return id; 47 } 48 49 52 public void setId(int id) 53 { 54 this.id = id; 55 } 56 57 60 public String getName() 61 { 62 return name; 63 } 64 65 68 public void setName(String name) 69 { 70 this.name = Security.escapeHtml(name); 71 } 72 73 76 public float getSalary() 77 { 78 return salary; 79 } 80 81 84 public void setSalary(float salary) 85 { 86 this.salary = salary; 87 } 88 89 92 public boolean equals(Object obj) 93 { 94 if (obj == null) 95 { 96 return false; 97 } 98 99 if (obj == this) 100 { 101 return true; 102 } 103 104 if (!this.getClass().equals(obj.getClass())) 105 { 106 return false; 107 } 108 109 Person that = (Person) obj; 110 111 if (this.id != that.id) 112 { 113 return false; 114 } 115 116 return true; 117 } 118 119 122 public int hashCode() 123 { 124 return 5924 + id; 125 } 126 127 130 public String toString() 131 { 132 return "Person[id=" + id + ",name=" + name + "]"; 133 } 134 135 private String name; 136 private String address; 137 private float salary; 138 private int id; 139 } 140 | Popular Tags |