From: Roland Häder Date: Tue, 23 Aug 2016 14:07:25 +0000 (+0200) Subject: sorted order: first primary key, then other data X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=90f3a5ef3571e4ed9f71d1dc5a81f405a4c764d4;p=jcountry-core.git sorted order: first primary key, then other data --- diff --git a/src/org/mxchange/jcountry/data/CountryData.java b/src/org/mxchange/jcountry/data/CountryData.java index 74a45de..1eb4300 100644 --- a/src/org/mxchange/jcountry/data/CountryData.java +++ b/src/org/mxchange/jcountry/data/CountryData.java @@ -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; + } + }