]> git.mxchange.org Git - jcountry-core.git/commitdiff
sorted order: first primary key, then other data
authorRoland Häder <roland@mxchange.org>
Tue, 23 Aug 2016 14:07:25 +0000 (16:07 +0200)
committerRoland Häder <roland@mxchange.org>
Tue, 23 Aug 2016 14:07:25 +0000 (16:07 +0200)
src/org/mxchange/jcountry/data/CountryData.java

index 74a45de8c8341582ac0cd1fbc04e6ef25faf12e4..1eb4300ef6c732cb8dffdcc33daba5a0d1be19f1 100644 (file)
@@ -128,26 +128,17 @@ public class CountryData implements Country {
 
                final Country other = (Country) object;
 
-               if (!Objects.equals(this.getCountryCode(), other.getCountryCode())) {
+               if (!Objects.equals(this.getCountryId(), other.getCountryId())) {
                        return false;
-               } else if (!Objects.equals(this.getCountryI18nKey(), other.getCountryI18nKey())) {
+               } else if (!Objects.equals(this.getCountryCode(), other.getCountryCode())) {
                        return false;
-               } else if (!Objects.equals(this.getCountryId(), other.getCountryId())) {
+               } else if (!Objects.equals(this.getCountryI18nKey(), other.getCountryI18nKey())) {
                        return false;
                }
 
                return true;
        }
 
-       @Override
-       public int hashCode () {
-               int hash = 7;
-               hash = 41 * hash + Objects.hashCode(this.getCountryCode());
-               hash = 41 * hash + Objects.hashCode(this.getCountryI18nKey());
-               hash = 41 * hash + Objects.hashCode(this.getCountryId());
-               return hash;
-       }
-
        @Override
        public String getCountryAbroadDialPrefix () {
                return this.countryAbroadDialPrefix;
@@ -230,4 +221,15 @@ public class CountryData implements Country {
                this.countryPhoneCode = countryPhoneCode;
        }
 
+       @Override
+       public int hashCode () {
+               int hash = 7;
+
+               hash = 41 * hash + Objects.hashCode(this.getCountryId());
+               hash = 41 * hash + Objects.hashCode(this.getCountryCode());
+               hash = 41 * hash + Objects.hashCode(this.getCountryI18nKey());
+
+               return hash;
+       }
+
 }