package org.mxchange.jphone.model.phonenumbers.mobileprovider;
import java.io.Serializable;
+import java.util.Objects;
+import org.mxchange.jcountry.model.data.Countries;
/**
* An utilities class for mobile providers
} else if (null == targetMobileProvider) {
// Throw NPE
throw new NullPointerException("targetMobileProvider is null"); //NOI18N
+ } else if (Objects.equals(sourceMobileProvider, targetMobileProvider)) {
+ // Is same mobile provider
+ throw new IllegalArgumentException("Source and target mobile provider are the same."); //NOI18N
}
// Copy all values
- targetMobileProvider.getProviderCountry().copyAll(sourceMobileProvider.getProviderCountry());
+ Countries.copyCountry(sourceMobileProvider.getProviderCountry(), targetMobileProvider.getProviderCountry());
targetMobileProvider.setProviderDialPrefix(sourceMobileProvider.getProviderDialPrefix());
targetMobileProvider.setProviderEntryCreated(sourceMobileProvider.getProviderEntryCreated());
targetMobileProvider.setProviderId(sourceMobileProvider.getProviderId());