1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.ibatis.submitted.nestedresulthandler_multiple_association;
17
18 public class Binome<T, U> {
19 private T one;
20 private U two;
21
22 public Binome() {
23 }
24
25 public Binome(final T one, final U two) {
26 this.one = one;
27 this.two = two;
28 }
29
30 public T getOne() {
31 return one;
32 }
33
34 public void setOne(T one) {
35 this.one = one;
36 }
37
38 public U getTwo() {
39 return two;
40 }
41
42 public void setTwo(U two) {
43 this.two = two;
44 }
45
46 @Override
47 public int hashCode() {
48 return (one != null ? one.hashCode() : 0) + (two != null ? two.hashCode() : 0);
49 }
50
51 @Override
52 public boolean equals(final Object obj) {
53 if (obj instanceof Binome<?, ?>) {
54 Binome<?, ?> bin = (Binome<?, ?>) obj;
55 return one != null && one.equals(bin.getOne()) && two != null && two.equals(bin.getTwo());
56 }
57 return super.equals(obj);
58 }
59
60 @Override
61 public String toString() {
62 return "Binome [one=" + one + ", two=" + two + "]";
63 }
64 }