View Javadoc
1   /*
2    *    Copyright 2009-2021 the original author or authors.
3    *
4    *    Licensed under the Apache License, Version 2.0 (the "License");
5    *    you may not use this file except in compliance with the License.
6    *    You may obtain a copy of the License at
7    *
8    *       http://www.apache.org/licenses/LICENSE-2.0
9    *
10   *    Unless required by applicable law or agreed to in writing, software
11   *    distributed under the License is distributed on an "AS IS" BASIS,
12   *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   *    See the License for the specific language governing permissions and
14   *    limitations under the License.
15   */
16  package org.apache.ibatis.submitted.extendresultmap;
17  
18  public class TestModel {
19  
20    private String a;
21    private String b;
22  
23    public TestModel() {
24    }
25  
26    public TestModel(String a, String b) {
27      super();
28      this.a = a;
29      this.b = b;
30    }
31  
32    public String getA() {
33      return a;
34    }
35  
36    public void setA(String a) {
37      this.a = a;
38    }
39  
40    public String getB() {
41      return b;
42    }
43  
44    public void setB(String b) {
45      this.b = b;
46    }
47  
48    @Override
49    public int hashCode() {
50      final int prime = 31;
51      int result = 1;
52      result = prime * result + ((a == null) ? 0 : a.hashCode());
53      result = prime * result + ((b == null) ? 0 : b.hashCode());
54      return result;
55    }
56  
57    @Override
58    public boolean equals(Object obj) {
59      if (this == obj)
60        return true;
61      if (obj == null)
62        return false;
63      if (getClass() != obj.getClass())
64        return false;
65      TestModel other = (TestModel) obj;
66      if (a == null) {
67        if (other.a != null)
68          return false;
69      } else if (!a.equals(other.a))
70        return false;
71      if (b == null) {
72        if (other.b != null)
73          return false;
74      } else if (!b.equals(other.b))
75        return false;
76      return true;
77    }
78  
79    @Override
80    public String toString() {
81      return "TestModel [a=" + a + ", b=" + b + "]";
82    }
83  }