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 BeanA
28 {
29 private boolean bool = true;
30 private int integer = 42;
31 private String string = "morph";
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( !BeanA.class.isAssignableFrom( obj.getClass() ) ){
42 return false;
43 }
44 return EqualsBuilder.reflectionEquals( this, obj );
45 }
46
47 public int getInteger()
48 {
49 return integer;
50 }
51
52 public String getString()
53 {
54 return string;
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 setInteger( int integer )
73 {
74 this.integer = integer;
75 }
76
77 public void setString( String string )
78 {
79 this.string = string;
80 }
81
82 public String toString()
83 {
84 return ToStringBuilder.reflectionToString( this, ToStringStyle.MULTI_LINE_STYLE );
85 }
86 }