1 16 package org.apache.commons.betwixt.io.read; 17 18 23 public class PersonBean { 24 25 private String forename; 26 private String surname; 27 28 public PersonBean() {} 29 30 public PersonBean(String forename, String surname) 31 { 32 setForename(forename); 33 setSurname(surname); 34 } 35 36 public String getForename() { 37 return forename; 38 } 39 40 public void setForename(String forename) { 41 this.forename = forename; 42 } 43 44 45 public String getSurname() { 46 return surname; 47 } 48 49 public void setSurname(String surname) { 50 this.surname = surname; 51 } 52 53 public String toString() { 54 return "[" + this.getClass().getName() + ": forename=" + forename + " surname=" + surname + "]"; 55 } 56 57 public boolean equals( Object obj ) { 58 if ( obj == null ) return false; 59 return this.hashCode() == obj.hashCode(); 60 } 61 62 public int hashCode() { 63 return toString().hashCode(); 64 } 65 } 66 | Popular Tags |