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.foreach_map;
17  
18  public class IntBoolMapEntry {
19    public IntBoolMapEntry() {
20    }
21  
22    public IntBoolMapEntry(Integer key, Boolean value) {
23      this.key = key;
24      this.value = value;
25    }
26  
27    public Integer getKey() {
28      return key;
29    }
30  
31    public void setKey(Integer key) {
32      this.key = key;
33    }
34  
35    public Boolean getValue() {
36      return value;
37    }
38  
39    public void setValue(Boolean value) {
40      this.value = value;
41    }
42  
43    @Override
44    public boolean equals(Object o) {
45      if (this == o)
46        return true;
47      if (o == null || getClass() != o.getClass())
48        return false;
49  
50      IntBoolMapEntry mapEntry = (IntBoolMapEntry) o;
51  
52      if (key != null ? !key.equals(mapEntry.key) : mapEntry.key != null)
53        return false;
54      if (value != null ? !value.equals(mapEntry.value) : mapEntry.value != null)
55        return false;
56  
57      return true;
58    }
59  
60    @Override
61    public int hashCode() {
62      int result = key != null ? key.hashCode() : 0;
63      result = 31 * result + (value != null ? value.hashCode() : 0);
64      return result;
65    }
66  
67    @Override
68    public String toString() {
69      return '{' + key.toString() + '=' + value + '}';
70    }
71  
72    private Integer key;
73    private Boolean value;
74  }