1 16 17 package org.apache.commons.betwixt; 18 19 23 public class NameBean { 24 25 private String name; 26 27 public NameBean() {} 28 29 public NameBean(String name) 30 { 31 setName(name); 32 } 33 34 public String getName() { 35 return name; 36 } 37 38 public void setName(String name) { 39 this.name = name; 40 } 41 42 public String toString() { 43 return "[" + this.getClass().getName() + ": name=" + name + "]"; 44 } 45 46 public boolean equals( Object obj ) { 47 if ( obj == null ) return false; 48 if ( obj instanceof NameBean && getName() != null ) { 49 return getName().equals(((NameBean) obj).getName()); 50 } 51 52 return false; 53 } 54 } 55 | Popular Tags |