1
2
3
4
5
6
7 package org.mule.module.json;
8
9 import java.util.Arrays;
10
11
12
13
14 public class TestBean
15 {
16
17 private String name;
18 private int id;
19 private double doublev;
20 private char[] options;
21 private String func1;
22
23 public TestBean()
24 {
25 super();
26 }
27
28 public TestBean(String name, int id, double doublev, String func1)
29 {
30 this.name = name;
31 this.id = id;
32 this.doublev = doublev;
33 this.func1 = func1;
34 }
35
36 public double getDoublev()
37 {
38 return doublev;
39 }
40
41 public void setDoublev(double doublev)
42 {
43 this.doublev = doublev;
44 }
45
46 public String getFunc1()
47 {
48 return func1;
49 }
50
51 public void setFunc1(String func1)
52 {
53 this.func1 = func1;
54 }
55
56 public int getId()
57 {
58 return id;
59 }
60
61 public void setId(int id)
62 {
63 this.id = id;
64 }
65
66 public String getName()
67 {
68 return name;
69 }
70
71 public void setName(String name)
72 {
73 this.name = name;
74 }
75
76 public char[] getOptions()
77 {
78 return options;
79 }
80
81 public void setOptions(char[] options)
82 {
83 this.options = options;
84 }
85
86 @Override
87 public boolean equals(Object o)
88 {
89 if (this == o)
90 {
91 return true;
92 }
93 if (o == null || getClass() != o.getClass())
94 {
95 return false;
96 }
97
98 TestBean testBean = (TestBean) o;
99
100 if (id != testBean.id)
101 {
102 return false;
103 }
104 if (func1 != null ? !func1.equals(testBean.func1) : testBean.func1 != null)
105 {
106 return false;
107 }
108 if (name != null ? !name.equals(testBean.name) : testBean.name != null)
109 {
110 return false;
111 }
112
113 return true;
114 }
115
116 @Override
117 public int hashCode()
118 {
119 int result;
120 long temp;
121 result = name != null ? name.hashCode() : 0;
122 result = 31 * result + id;
123 temp = doublev != +0.0d ? Double.doubleToLongBits(doublev) : 0L;
124 result = 31 * result + (int) (temp ^ (temp >>> 32));
125 result = 31 * result + (options != null ? Arrays.hashCode(options) : 0);
126 result = 31 * result + (func1 != null ? func1.hashCode() : 0);
127 return result;
128 }
129 }