1
2
3
4
5
6
7
8
9
10 package org.mule.tck.testmodels.fruit;
11
12
13
14
15 public class GrapeFruit implements Fruit
16 {
17 private Integer segments = new Integer(10);
18 private Double radius = new Double(4.34);
19 private String brand = "Pirulo";
20 private boolean red = false;
21 private boolean bitten = false;
22
23 public GrapeFruit()
24 {
25 super();
26 }
27
28 public GrapeFruit(Integer segments, Double radius, String brand, boolean red)
29 {
30 this.segments = segments;
31 this.radius = radius;
32 this.brand = brand;
33 this.red = red;
34 }
35
36 public String getBrand()
37 {
38 return brand;
39 }
40
41 public Integer getSegments()
42 {
43 return segments;
44 }
45
46 public Double getRadius()
47 {
48 return radius;
49 }
50
51 public void setBrand(String string)
52 {
53 brand = string;
54 }
55
56 public void setSegments(Integer integer)
57 {
58 segments = integer;
59 }
60
61 public void setRadius(Double double1)
62 {
63 radius = double1;
64 }
65
66 public boolean isRed()
67 {
68 return red;
69 }
70
71 public void setRed(boolean red)
72 {
73 this.red = red;
74 }
75
76 public void bite()
77 {
78 bitten = true;
79 }
80
81 public boolean isBitten()
82 {
83 return bitten;
84 }
85
86 @Override
87 public boolean equals(Object o)
88 {
89 if (this == o)
90 {
91 return true;
92 }
93 if (!(o instanceof GrapeFruit))
94 {
95 return false;
96 }
97
98 GrapeFruit that = (GrapeFruit) o;
99
100 if (red != that.red)
101 {
102 return false;
103 }
104 if (brand != null ? !brand.equals(that.brand) : that.brand != null)
105 {
106 return false;
107 }
108 if (radius != null ? !radius.equals(that.radius) : that.radius != null)
109 {
110 return false;
111 }
112 if (segments != null ? !segments.equals(that.segments) : that.segments != null)
113 {
114 return false;
115 }
116
117 return true;
118 }
119
120 @Override
121 public int hashCode()
122 {
123 int result = segments != null ? segments.hashCode() : 0;
124 result = 31 * result + (radius != null ? radius.hashCode() : 0);
125 result = 31 * result + (brand != null ? brand.hashCode() : 0);
126 result = 31 * result + (red ? 1 : 0);
127 result = 31 * result + (bitten ? 1 : 0);
128 return result;
129 }
130 }