View Javadoc
1   /*
2    *    Copyright 2009-2024 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 StringStringMapEntry {
19    public StringStringMapEntry() {
20    }
21  
22    public StringStringMapEntry(String key, String value) {
23      this.key = key;
24      this.value = value;
25    }
26  
27    public Object getKey() {
28      return key;
29    }
30  
31    public void setKey(String key) {
32      this.key = key;
33    }
34  
35    public String getValue() {
36      return value;
37    }
38  
39    public void setValue(String 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      StringStringMapEntry mapEntry = (StringStringMapEntry) o;
53  
54      return key != null ? key.equals(mapEntry.key)
55          : mapEntry.key == null && value != null ? value.equals(mapEntry.value) : mapEntry.value == null;
56    }
57  
58    @Override
59    public int hashCode() {
60      int result = key != null ? key.hashCode() : 0;
61      return 31 * result + (value != null ? value.hashCode() : 0);
62    }
63  
64    @Override
65    public String toString() {
66      return '{' + key + '=' + value + '}';
67    }
68  
69    private String key;
70    private String value;
71  }