]> git.mxchange.org Git - pizzaservice-war.git/blobdiff - src/java/org/mxchange/pizzaapplication/beans/contact/PizzaContactWebSessionBean.java
Please cherry-pick:
[pizzaservice-war.git] / src / java / org / mxchange / pizzaapplication / beans / contact / PizzaContactWebSessionBean.java
index fa011585cafd581dd60bc139e783ffc467deeac9..8cade173de3b40c63851e82f6d4abff3e184c54b 100644 (file)
@@ -174,29 +174,29 @@ public class PizzaContactWebSessionBean extends BasePizzaController implements P
        private boolean isMobileUnlinked;
 
        /**
-        * Mobile number's carrier
+        * Phone number area code
         */
-       private MobileProvider mobileCarrier;
+       private Integer landLineAreaCode;
 
        /**
-        * Mobile number
+        * Country instance for phone number
         */
-       private Long mobileNumber;
+       private Country landLineCountry;
 
        /**
-        * Phone number area code
+        * Phone number
         */
-       private Integer phoneAreaCode;
+       private Long landLineNumber;
 
        /**
-        * Country instance for phone number
+        * Mobile number
         */
-       private Country phoneCountry;
+       private Long mobileNumber;
 
        /**
-        * Phone number
+        * Mobile number's carrier
         */
-       private Long phoneNumber;
+       private MobileProvider mobileProvider;
 
        /**
         * A list of all selectable contacts
@@ -465,8 +465,8 @@ public class PizzaContactWebSessionBean extends BasePizzaController implements P
                assert (this.isRequiredPersonalDataSet()) : "not all personal data is set"; //NOI18N
 
                // Generate phone number
-               DialableLandLineNumber phone = new LandLineNumber(this.getPhoneCountry(), this.getPhoneAreaCode(), this.getPhoneNumber());
-               DialableMobileNumber mobile = new MobileNumber(this.getMobileCarrier(), this.getMobileNumber());
+               DialableLandLineNumber phone = new LandLineNumber(this.getLandLineCountry(), this.getLandLineAreaCode(), this.getLandLineNumber());
+               DialableMobileNumber mobile = new MobileNumber(this.getMobileProvider(), this.getMobileNumber());
                DialableFaxNumber fax = new FaxNumber(this.getFaxCountry(), this.getFaxAreaCode(), this.getFaxNumber());
 
                // Create new contact
@@ -482,7 +482,7 @@ public class PizzaContactWebSessionBean extends BasePizzaController implements P
                contact.setContactComment(this.getComment());
 
                // Don't set null or wrong references
-               if ((phone instanceof DialableLandLineNumber) && (phone.getPhoneCountry() instanceof Country) && (this.getPhoneAreaCode() != null) && (this.getPhoneNumber() != null) && (this.getPhoneAreaCode() > 0) && (this.getPhoneNumber() > 0)) {
+               if ((phone instanceof DialableLandLineNumber) && (phone.getPhoneCountry() instanceof Country) && (this.getLandLineAreaCode() != null) && (this.getLandLineNumber() != null) && (this.getLandLineAreaCode() > 0) && (this.getLandLineNumber() > 0)) {
                        // Now the number must be given
                        if (phone.getPhoneAreaCode() == null) {
                                // Is null
@@ -524,7 +524,7 @@ public class PizzaContactWebSessionBean extends BasePizzaController implements P
                }
 
                // Is the provider set?
-               if ((mobile instanceof DialableMobileNumber) && (this.getMobileCarrier() instanceof MobileProvider) && (this.getMobileNumber() != null) && (this.getMobileNumber() > 0)) {
+               if ((mobile instanceof DialableMobileNumber) && (this.getMobileProvider() instanceof MobileProvider) && (this.getMobileNumber() != null) && (this.getMobileNumber() > 0)) {
                        // Is the number set?
                        if (mobile.getPhoneNumber() == null) {
                                // Is null
@@ -577,10 +577,10 @@ public class PizzaContactWebSessionBean extends BasePizzaController implements P
                contact.setContactCountry(this.getCountry());
 
                // Update contact's mobile number
-               this.isMobileUnlinked = ContactUtils.updateMobileNumber(contact, this.getMobileCarrier(), this.getMobileNumber());
+               this.isMobileUnlinked = ContactUtils.updateMobileNumber(contact, this.getMobileProvider(), this.getMobileNumber());
 
                // Update contact's land-line number
-               this.isLandLineUnlinked = ContactUtils.updateLandLineNumber(contact, this.getPhoneCountry(), this.getPhoneAreaCode(), this.getPhoneNumber());
+               this.isLandLineUnlinked = ContactUtils.updateLandLineNumber(contact, this.getLandLineCountry(), this.getLandLineAreaCode(), this.getLandLineNumber());
 
                // Update contact's fax number
                this.isFaxUnlinked = ContactUtils.updateFaxNumber(contact, this.getFaxCountry(), this.getFaxAreaCode(), this.getFaxNumber());
@@ -746,53 +746,53 @@ public class PizzaContactWebSessionBean extends BasePizzaController implements P
        }
 
        @Override
-       public MobileProvider getMobileCarrier () {
-               return this.mobileCarrier;
+       public Integer getLandLineAreaCode () {
+               return this.landLineAreaCode;
        }
 
        @Override
-       public void setMobileCarrier (final MobileProvider mobileCarrier) {
-               this.mobileCarrier = mobileCarrier;
+       public void setLandLineAreaCode (final Integer landLineAreaCode) {
+               this.landLineAreaCode = landLineAreaCode;
        }
 
        @Override
-       public Long getMobileNumber () {
-               return this.mobileNumber;
+       public Country getLandLineCountry () {
+               return this.landLineCountry;
        }
 
        @Override
-       public void setMobileNumber (final Long mobileNumber) {
-               this.mobileNumber = mobileNumber;
+       public void setLandLineCountry (final Country landLineCountry) {
+               this.landLineCountry = landLineCountry;
        }
 
        @Override
-       public Integer getPhoneAreaCode () {
-               return this.phoneAreaCode;
+       public Long getLandLineNumber () {
+               return this.landLineNumber;
        }
 
        @Override
-       public void setPhoneAreaCode (final Integer phoneAreaCode) {
-               this.phoneAreaCode = phoneAreaCode;
+       public void setLandLineNumber (final Long landLineNumber) {
+               this.landLineNumber = landLineNumber;
        }
 
        @Override
-       public Country getPhoneCountry () {
-               return this.phoneCountry;
+       public Long getMobileNumber () {
+               return this.mobileNumber;
        }
 
        @Override
-       public void setPhoneCountry (final Country phoneCountry) {
-               this.phoneCountry = phoneCountry;
+       public void setMobileNumber (final Long mobileNumber) {
+               this.mobileNumber = mobileNumber;
        }
 
        @Override
-       public Long getPhoneNumber () {
-               return this.phoneNumber;
+       public MobileProvider getMobileProvider () {
+               return this.mobileProvider;
        }
 
        @Override
-       public void setPhoneNumber (final Long phoneNumber) {
-               this.phoneNumber = phoneNumber;
+       public void setMobileProvider (final MobileProvider mobileProvider) {
+               this.mobileProvider = mobileProvider;
        }
 
        @Override
@@ -1023,10 +1023,10 @@ public class PizzaContactWebSessionBean extends BasePizzaController implements P
                // - contact data
                this.setEmailAddress(null);
                this.setEmailAddressRepeat(null);
-               this.setPhoneAreaCode(null);
-               this.setPhoneCountry(null);
-               this.setPhoneNumber(null);
-               this.setMobileCarrier(null);
+               this.setLandLineAreaCode(null);
+               this.setLandLineCountry(null);
+               this.setLandLineNumber(null);
+               this.setMobileProvider(null);
                this.setMobileNumber(null);
                this.setFaxAreaCode(null);
                this.setFaxCountry(null);
@@ -1078,13 +1078,13 @@ public class PizzaContactWebSessionBean extends BasePizzaController implements P
 
                // - contact data
                if ((phone instanceof DialableLandLineNumber) && (phone.getPhoneAreaCode() > 0)) {
-                       this.setPhoneCountry(phone.getPhoneCountry());
-                       this.setPhoneAreaCode(phone.getPhoneAreaCode());
-                       this.setPhoneNumber(phone.getPhoneNumber());
+                       this.setLandLineCountry(phone.getPhoneCountry());
+                       this.setLandLineAreaCode(phone.getPhoneAreaCode());
+                       this.setLandLineNumber(phone.getPhoneNumber());
                }
 
                if ((mobile instanceof DialableMobileNumber) && (mobile.getMobileProvider() instanceof MobileProvider)) {
-                       this.setMobileCarrier(mobile.getMobileProvider());
+                       this.setMobileProvider(mobile.getMobileProvider());
                        this.setMobileNumber(mobile.getPhoneNumber());
                }