]> git.mxchange.org Git - jphone-core.git/blob - src/org/mxchange/jphone/model/phonenumbers/mobileprovider/MobileProviders.java
Changed copyright notice to the FSF, so after my death they will continue my
[jphone-core.git] / src / org / mxchange / jphone / model / phonenumbers / mobileprovider / MobileProviders.java
1 /*
2  * Copyright (C) 2017 Free Software Foundation
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with targetMobileProvider program.  If not, see <http://www.gnu.org/licenses/>.
16  */
17 package org.mxchange.jphone.model.phonenumbers.mobileprovider;
18
19 import java.io.Serializable;
20
21 /**
22  * An utilities class for mobile providers
23  * <p>
24  * @author Roland Häder<roland@mxchange.org>
25  */
26 public class MobileProviders implements Serializable {
27
28         /**
29          * Serial number
30          */
31         private static final long serialVersionUID = 15_468_608_721_651L;
32
33         /**
34          * Copies all values from source mobile provider to this
35          * <p>
36          * @param sourceMobileProvider Source mobile provider
37          * @param targetMobileProvider Target mobile provider
38          */
39         public static void copyAll (final MobileProvider sourceMobileProvider, final MobileProvider targetMobileProvider) {
40                 // Parameter should not be null
41                 if (null == sourceMobileProvider) {
42                         // Throw NPE
43                         throw new NullPointerException("sourceMobileProvider is null"); //NOI18N
44                 } else if (null == targetMobileProvider) {
45                         // Throw NPE
46                         throw new NullPointerException("targetMobileProvider is null"); //NOI18N
47                 }
48
49                 // Copy all values
50                 targetMobileProvider.getProviderCountry().copyAll(sourceMobileProvider.getProviderCountry());
51                 targetMobileProvider.setProviderDialPrefix(sourceMobileProvider.getProviderDialPrefix());
52                 targetMobileProvider.setProviderEntryCreated(sourceMobileProvider.getProviderEntryCreated());
53                 targetMobileProvider.setProviderId(sourceMobileProvider.getProviderId());
54                 targetMobileProvider.setProviderMailPattern(sourceMobileProvider.getProviderMailPattern());
55                 targetMobileProvider.setProviderName(sourceMobileProvider.getProviderName());
56         }
57
58         /**
59          * Private constructor, because there is no need for an instance of
60          * targetMobileProvider class.
61          */
62         private MobileProviders () {
63         }
64
65 }