View Javadoc
1   /*
2    *    Copyright 2009-2022 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.keygen;
17  
18  // See gh-1719
19  public class NpeCountry {
20    private Integer id;
21    private String countryname;
22    private String countrycode;
23  
24    public NpeCountry() {
25    }
26  
27    public NpeCountry(String countryname, String countrycode) {
28      this.countryname = countryname;
29      this.countrycode = countrycode;
30    }
31  
32    public Integer getId() {
33      return id;
34    }
35  
36    public void setId(Integer id) {
37      this.id = id;
38    }
39  
40    public String getCountryname() {
41      return countryname;
42    }
43  
44    public void setCountryname(String countryname) {
45      this.countryname = countryname;
46    }
47  
48    public String getCountrycode() {
49      return countrycode;
50    }
51  
52    public void setCountrycode(String countrycode) {
53      this.countrycode = countrycode;
54    }
55  
56    @Override
57    public boolean equals(Object o) {
58      if (this == o) {
59        return true;
60      }
61      if (o == null || getClass() != o.getClass()) {
62        return false;
63      }
64      NpeCountry other = (NpeCountry) o;
65      // throws NPE when id is null
66      return id.equals(other.id);
67    }
68  
69    @Override
70    public int hashCode() {
71      // throws NPE when id is null
72      return id.hashCode();
73    }
74  }