View Javadoc
1   /*
2    *    Copyright 2009-2023 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    *       https://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      }
48      if (o == null || getClass() != o.getClass()) {
49        return false;
50      }
51  
52      IntBoolMapEntry mapEntry = (IntBoolMapEntry) o;
53  
54      if ((key != null ? !key.equals(mapEntry.key) : mapEntry.key != null)
55          || (value != null ? !value.equals(mapEntry.value) : mapEntry.value != null)) {
56        return false;
57      }
58  
59      return true;
60    }
61  
62    @Override
63    public int hashCode() {
64      int result = key != null ? key.hashCode() : 0;
65      return 31 * result + (value != null ? value.hashCode() : 0);
66    }
67  
68    @Override
69    public String toString() {
70      return '{' + key.toString() + '=' + value + '}';
71    }
72  
73    private Integer key;
74    private Boolean value;
75  }