KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > test > mapcompelem > Part


1 //$Id: Part.java,v 1.2 2005/02/12 07:27:28 steveebersole Exp $
2
package org.hibernate.test.mapcompelem;
3
4
5 /**
6  * @author Gavin King
7  */

8 public class Part {
9     private String JavaDoc name;
10     private String JavaDoc description;
11     Part() {}
12     public Part(String JavaDoc n, String JavaDoc pw) {
13         name=n;
14         description = pw;
15     }
16     public String JavaDoc getName() {
17         return name;
18     }
19     public void setName(String JavaDoc name) {
20         this.name = name;
21     }
22     public String JavaDoc getDescription() {
23         return description;
24     }
25     public void setDescription(String JavaDoc password) {
26         this.description = password;
27     }
28     public boolean equals(Object JavaDoc that) {
29         return ( (Part) that ).getName().equals(name);
30     }
31     public int hashCode() {
32         return name.hashCode();
33     }
34     public String JavaDoc toString() {
35         return name + ":" + description;
36     }
37 }
38
Popular Tags