View Javadoc

1   /*
2    * $Id: FruitCollection.java 19191 2010-08-25 21:05:23Z tcarlson $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  package org.mule.module.json.transformers;
11  
12  import org.mule.tck.testmodels.fruit.Apple;
13  import org.mule.tck.testmodels.fruit.Banana;
14  import org.mule.tck.testmodels.fruit.Orange;
15  
16  /**
17   * TODO
18   */
19  public class FruitCollection
20  {
21      private Apple apple;
22      private Banana banana;
23      private Orange orange;
24  
25      public FruitCollection()
26      {
27          super();
28      }
29  
30      public FruitCollection(Apple apple, Banana banana, Orange orange)
31      {
32          this.apple = apple;
33          this.banana = banana;
34          this.orange = orange;
35      }
36  
37      public Apple getApple()
38      {
39          return apple;
40      }
41  
42      public Banana getBanana()
43      {
44          return banana;
45      }
46  
47      public Orange getOrange()
48      {
49          return orange;
50      }
51  
52      public void setApple(Apple apple)
53      {
54          this.apple = apple;
55      }
56  
57      public void setBanana(Banana banana)
58      {
59          this.banana = banana;
60      }
61  
62      public void setOrange(Orange orange)
63      {
64          this.orange = orange;
65      }
66  
67      @Override
68      public boolean equals(Object o)
69      {
70          if (this == o)
71          {
72              return true;
73          }
74          if (o == null || getClass() != o.getClass())
75          {
76              return false;
77          }
78  
79          FruitCollection that = (FruitCollection) o;
80  
81          if (apple != null ? !apple.equals(that.apple) : that.apple != null)
82          {
83              return false;
84          }
85          if (banana != null ? !banana.equals(that.banana) : that.banana != null)
86          {
87              return false;
88          }
89          if (orange != null ? !orange.equals(that.orange) : that.orange != null)
90          {
91              return false;
92          }
93  
94          return true;
95      }
96  
97      @Override
98      public int hashCode()
99      {
100         int result = apple != null ? apple.hashCode() : 0;
101         result = 31 * result + (banana != null ? banana.hashCode() : 0);
102         result = 31 * result + (orange != null ? orange.hashCode() : 0);
103         return result;
104     }
105 }