X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2Forg%2Fmxchange%2Fjcountry%2Fmodel%2Fdata%2FCountries.java;fp=src%2Forg%2Fmxchange%2Fjcountry%2Fmodel%2Fdata%2FCountries.java;h=0000000000000000000000000000000000000000;hb=e6285ceb313d6fdd50688a97fef1fef9ff218d6d;hp=825ec111732607ebacc8111c3891b27169486d19;hpb=ad73a3f65c4a4f5e595b37e578aa7548a36aa0c0;p=jcountry-core.git diff --git a/src/org/mxchange/jcountry/model/data/Countries.java b/src/org/mxchange/jcountry/model/data/Countries.java deleted file mode 100644 index 825ec11..0000000 --- a/src/org/mxchange/jcountry/model/data/Countries.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (C) 2022 Free Software Foundation - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package org.mxchange.jcountry.model.data; - -import java.io.Serializable; -import java.util.Objects; - -/** - * An utilities class for countries - *

- * @author Roland Häder - */ -public class Countries implements Serializable { - - /** - * Serial number - */ - private static final long serialVersionUID = 286_956_737_410L; - - /** - * Copies data from sourceCountry to targetCountry. - *

- * @param sourceCountry Source Country instance to copy data from - * @param targetCountry Target Country instance to copy data to - *

- * @throws NullPointerException If sourceCountry or targetCountry is null - * @throws IllegalArgumentException If both Country instances are equal - */ - public static void copyCountryData (final Country sourceCountry, final Country targetCountry) { - // Parameters should not be null - if (null == sourceCountry) { - // Throw NPE - throw new NullPointerException("sourceCountry is null"); //NOI18N - } else if (null == targetCountry) { - // Throw NPE - throw new NullPointerException("targetCountry is null"); //NOI18N - } else if (Objects.equals(sourceCountry, targetCountry)) { - /* - * Source and target country should never be equal, please check the - * condition before invoking this method. - */ - throw new IllegalArgumentException("Both sourceCountry and targetCountry are equal."); - } - - // Copy all fields - targetCountry.setCountryAbroadDialPrefix(sourceCountry.getCountryAbroadDialPrefix()); - targetCountry.setCountryCode(sourceCountry.getCountryCode()); - targetCountry.setCountryExternalDialPrefix(sourceCountry.getCountryExternalDialPrefix()); - targetCountry.setCountryI18nKey(sourceCountry.getCountryI18nKey()); - targetCountry.setCountryId(sourceCountry.getCountryId()); - targetCountry.setCountryIsLocalPrefixRequired(sourceCountry.getCountryIsLocalPrefixRequired()); - targetCountry.setCountryPhoneCode(sourceCountry.getCountryPhoneCode()); - } - - /** - * Utility classes should not have instances - */ - private Countries () { - } - -}