From 90f3a5ef3571e4ed9f71d1dc5a81f405a4c764d4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Tue, 23 Aug 2016 16:07:25 +0200 Subject: [PATCH] sorted order: first primary key, then other data --- .../mxchange/jcountry/data/CountryData.java | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) 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; + } + } -- 2.39.5