1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package net.sf.ezmorph.bean.sample;
18
19 import org.apache.commons.lang.builder.EqualsBuilder;
20 import org.apache.commons.lang.builder.HashCodeBuilder;
21 import org.apache.commons.lang.builder.ToStringBuilder;
22 import org.apache.commons.lang.builder.ToStringStyle;
23
24
25
26
27 public class BeanD
28 {
29 private boolean bool = true;
30 private double decimal = 0d;
31 private int integer = 42;
32
33 public boolean equals( Object obj )
34 {
35 if( obj == this ){
36 return true;
37 }
38 if( obj == null ){
39 return false;
40 }
41 if( !BeanD.class.isAssignableFrom( obj.getClass() ) ){
42 return false;
43 }
44 return EqualsBuilder.reflectionEquals( this, obj );
45 }
46
47 public double getDecimal()
48 {
49 return decimal;
50 }
51
52 public int getInteger()
53 {
54 return integer;
55 }
56
57 public int hashCode()
58 {
59 return HashCodeBuilder.reflectionHashCode( this );
60 }
61
62 public boolean isBool()
63 {
64 return bool;
65 }
66
67 public void setBool( boolean bool )
68 {
69 this.bool = bool;
70 }
71
72 public void setDecimal( double decimal )
73 {
74 this.decimal = decimal;
75 }
76
77 public void setInteger( int integer )
78 {
79 this.integer = integer;
80 }
81
82 public String toString()
83 {
84 return ToStringBuilder.reflectionToString( this, ToStringStyle.MULTI_LINE_STYLE );
85 }
86 }