1 package net.sf.dozer.util.mapping.vo.set; 2 3 import java.util.Date ; 4 import java.util.Set ; 5 6 import net.sf.dozer.util.mapping.vo.BaseTestObject; 7 8 public class SomeVO extends BaseTestObject { 9 10 private Integer field1; 11 private Set field2; 12 13 public Integer getField1() { 14 return field1; 15 } 16 public void setField1(Integer field1) { 17 this.field1 = field1; 18 } 19 20 public Set getField2() { 21 return field2; 22 } 23 public void setField2(Set field2) { 24 this.field2 = field2; 25 } 26 public boolean equals(Object obj) { 27 if (this == obj) 28 return true; 29 if (!super.equals(obj)) 30 return false; 31 if (getClass() != obj.getClass()) 32 return false; 33 final SomeVO other = (SomeVO) obj; 34 if (field2 == null) { 35 if (other.field2 != null) 36 return false; 37 } else if (!field2.equals(other.field2)) 38 return false; 39 return true; 40 } 41 42 public int hashCode() { 43 final int PRIME = 31; 44 int result = super.hashCode(); 45 result = PRIME * result 46 + ((field2 == null) ? 0 : field2.hashCode()); 47 return result; 48 } 49 } 50 | Popular Tags |