]> git.mxchange.org Git - jphone-core.git/commitdiff
introduced copyAll() methods for all 3 kinds. These methods will help later in EJBs...
authorRoland Haeder <roland@mxchange.org>
Tue, 8 Mar 2016 21:09:40 +0000 (22:09 +0100)
committerRoland Haeder <roland@mxchange.org>
Tue, 8 Mar 2016 21:09:40 +0000 (22:09 +0100)
src/org/mxchange/jphone/phonenumbers/DialableNumber.java
src/org/mxchange/jphone/phonenumbers/cellphone/CellphoneNumber.java
src/org/mxchange/jphone/phonenumbers/cellphone/DialableCellphoneNumber.java
src/org/mxchange/jphone/phonenumbers/fax/DialableFaxNumber.java
src/org/mxchange/jphone/phonenumbers/fax/FaxNumber.java
src/org/mxchange/jphone/phonenumbers/landline/DialableLandLineNumber.java
src/org/mxchange/jphone/phonenumbers/landline/LandLineNumber.java

index e1da0c5cf6dc2a5db54451ffddf31d0c909395e3..5996101f5ae30614f562017ef7599a4d6210228d 100644 (file)
@@ -21,7 +21,7 @@ import java.util.Calendar;
 import org.mxchange.jcountry.data.Country;
 
 /**
- * A POJO for dialable numbers
+ * A POJI for dial-able numbers
  * <p>
  * @author Roland Haeder<roland@mxchange.org>
  */
index d4a191e49bad6745069ee192b3ff40cf3b7cd643..b69c4da8e0eb14013b8645dab76b8594bb5254f6 100644 (file)
@@ -106,6 +106,15 @@ public class CellphoneNumber implements DialableCellphoneNumber, Comparable<Dial
                throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
        }
 
+       @Override
+       public void copyAll (final DialableCellphoneNumber sourceNumber) {
+               // Copy all
+               this.setCellphoneProvider(sourceNumber.getCellphoneProvider());
+               this.setPhoneEntryCreated(sourceNumber.getPhoneEntryCreated());
+               this.setPhoneId(sourceNumber.getPhoneId());
+               this.setPhoneNumber(sourceNumber.getPhoneNumber());
+       }
+
        @Override
        public boolean equals (final Object object) {
                if (object == null) {
index 41710e1622239c49f59c601433c5aacd38e10351..8776426b37b02fc0b354bd2bd9c54c11f1b92b40 100644 (file)
@@ -40,6 +40,13 @@ public interface DialableCellphoneNumber extends DialableNumber {
         */
        void setCellphoneProvider (final SmsProvider cellphoneProvider);
 
+       /**
+        * Copy all fields from source object to this
+        * <p>
+        * @param sourceNumber Source number object
+        */
+       void copyAll (final DialableCellphoneNumber sourceNumber);
+
        @Override
        boolean equals (final Object object);
 
index 391094aa40a78cb92b065f3929651e34083b3d46..14e5155a6e5d735f04b243a65f055896f95674a7 100644 (file)
@@ -25,6 +25,13 @@ import org.mxchange.jphone.phonenumbers.DialableNumber;
  */
 public interface DialableFaxNumber extends DialableNumber {
 
+       /**
+        * Copy all fields from source object to this
+        * <p>
+        * @param sourceNumber Source number object
+        */
+       void copyAll (final DialableFaxNumber sourceNumber);
+
        @Override
        boolean equals (final Object object);
 
index 9fd4b39d68b2a423bd7637b33fa770afeedc8b0e..2beb7bd40469be1fa5fa62615e181ded9cea0591 100644 (file)
@@ -114,6 +114,16 @@ public class FaxNumber implements DialableFaxNumber, Comparable<DialableFaxNumbe
                throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
        }
 
+       @Override
+       public void copyAll (final DialableFaxNumber sourceNumber) {
+               // Copy all
+               this.setPhoneAreaCode(sourceNumber.getPhoneAreaCode());
+               this.setPhoneCountry(sourceNumber.getPhoneCountry());
+               this.setPhoneEntryCreated(sourceNumber.getPhoneEntryCreated());
+               this.setPhoneId(sourceNumber.getPhoneId());
+               this.setPhoneNumber(sourceNumber.getPhoneNumber());
+       }
+
        @Override
        public boolean equals (final Object object) {
                if (object == null) {
index 643b2a6abda7e029d94f21fa7f17cc045e95cdc7..2c91cbc63bd5d5db64e9a063819e87fc6bcbe647 100644 (file)
@@ -25,6 +25,13 @@ import org.mxchange.jphone.phonenumbers.DialableNumber;
  */
 public interface DialableLandLineNumber extends DialableNumber {
 
+       /**
+        * Copy all fields from source object to this
+        * <p>
+        * @param sourceNumber Source number object
+        */
+       void copyAll (final DialableLandLineNumber sourceNumber);
+
        @Override
        boolean equals (final Object object);
 
index dbc61f9db55630d5ea1d7e9fda63c42d6bd38a7f..44a373cf1e5afc5bb2a4d9432878be224c33c6e8 100644 (file)
@@ -114,6 +114,16 @@ public class LandLineNumber implements DialableLandLineNumber, Comparable<Dialab
                throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
        }
 
+       @Override
+       public void copyAll (final DialableLandLineNumber sourceNumber) {
+               // Copy all
+               this.setPhoneAreaCode(sourceNumber.getPhoneAreaCode());
+               this.setPhoneCountry(sourceNumber.getPhoneCountry());
+               this.setPhoneEntryCreated(sourceNumber.getPhoneEntryCreated());
+               this.setPhoneId(sourceNumber.getPhoneId());
+               this.setPhoneNumber(sourceNumber.getPhoneNumber());
+       }
+
        @Override
        public boolean equals (final Object object) {
                if (object == null) {