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