]> git.mxchange.org Git - jphone-core.git/commitdiff
resorted members
authorRoland Haeder <roland@mxchange.org>
Sat, 20 Feb 2016 21:05:26 +0000 (22:05 +0100)
committerRoland Haeder <roland@mxchange.org>
Sat, 20 Feb 2016 21:05:26 +0000 (22:05 +0100)
src/org/mxchange/jphone/phonenumbers/cellphone/CellphoneNumber.java
src/org/mxchange/jphone/phonenumbers/fax/FaxNumber.java
src/org/mxchange/jphone/phonenumbers/smsprovider/CellphoneProvider.java

index 2ec89ecde25d7bed0254cb6fdd8cdbc0b6e2794c..d792811da985946c4dea45685b995754509bba54 100644 (file)
@@ -49,14 +49,6 @@ public class CellphoneNumber implements DialableCellphoneNumber, Comparable<Dial
         */
        private static final long serialVersionUID = 13_859_879_482_106L;
 
-       /**
-        * Id number
-        */
-       @Id
-       @GeneratedValue (strategy = GenerationType.IDENTITY)
-       @Column (name = "cellphone_id", length = 20, updatable = false, nullable = false)
-       private Long phoneId;
-
        /**
         * Connection to table "cellphone_provider" (for dial prefix and more data)
         */
@@ -64,13 +56,6 @@ public class CellphoneNumber implements DialableCellphoneNumber, Comparable<Dial
        @OneToOne (targetEntity = CellphoneProvider.class, cascade = CascadeType.MERGE, optional = false, fetch = FetchType.EAGER)
        private SmsProvider cellphoneProvider;
 
-       /**
-        * Number without prefix to dial
-        */
-       @Basic (optional = false)
-       @Column (name = "cellphone_number", length = 20, nullable = false)
-       private Long phoneNumber;
-
        /**
         * Timestamp when this entry has been created
         */
@@ -79,6 +64,21 @@ public class CellphoneNumber implements DialableCellphoneNumber, Comparable<Dial
        @Column (name = "cellphone_entry_created", nullable = false, updatable = false)
        private Calendar phoneEntryCreated;
 
+       /**
+        * Id number
+        */
+       @Id
+       @GeneratedValue (strategy = GenerationType.IDENTITY)
+       @Column (name = "cellphone_id", length = 20, updatable = false, nullable = false)
+       private Long phoneId;
+
+       /**
+        * Number without prefix to dial
+        */
+       @Basic (optional = false)
+       @Column (name = "cellphone_number", length = 20, nullable = false)
+       private Long phoneNumber;
+
        /**
         * Contructor with cellphone carrier and number
         * <p>
@@ -98,6 +98,11 @@ public class CellphoneNumber implements DialableCellphoneNumber, Comparable<Dial
        protected CellphoneNumber () {
        }
 
+       @Override
+       public int compareTo (final DialableCellphoneNumber dialableCellphoneNumber) {
+               throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
+       }
+
        @Override
        public boolean equals (final Object object) {
                if (object == null) {
@@ -117,6 +122,36 @@ public class CellphoneNumber implements DialableCellphoneNumber, Comparable<Dial
                return true;
        }
 
+       @Override
+       public int hashCode () {
+               int hash = 5;
+               hash = 97 * hash + Objects.hashCode(this.getCellphoneProvider());
+               hash = 97 * hash + Objects.hashCode(this.getPhoneNumber());
+               return hash;
+       }
+
+       @Override
+       public SmsProvider getCellphoneProvider () {
+               return this.cellphoneProvider;
+       }
+
+       @Override
+       public void setCellphoneProvider (final SmsProvider cellphoneProvider) {
+               this.cellphoneProvider = cellphoneProvider;
+       }
+
+       @Override
+       @Deprecated
+       public Integer getPhoneAreaCode () {
+               throw new UnsupportedOperationException("Cellphone numbers don't have area codes. Please fix your code."); //NOI18N
+       }
+
+       @Override
+       @Deprecated
+       public void setPhoneAreaCode (final Integer phoneAreaCode) {
+               throw new UnsupportedOperationException("Cellphone numbers don't have area codes. Please fix your code."); //NOI18N
+       }
+
        @Override
        @Deprecated
        public Country getPhoneCountry () {
@@ -149,16 +184,6 @@ public class CellphoneNumber implements DialableCellphoneNumber, Comparable<Dial
                this.phoneId = phoneId;
        }
 
-       @Override
-       public SmsProvider getCellphoneProvider () {
-               return this.cellphoneProvider;
-       }
-
-       @Override
-       public void setCellphoneProvider (final SmsProvider cellphoneProvider) {
-               this.cellphoneProvider = cellphoneProvider;
-       }
-
        @Override
        public Long getPhoneNumber () {
                return this.phoneNumber;
@@ -169,28 +194,4 @@ public class CellphoneNumber implements DialableCellphoneNumber, Comparable<Dial
                this.phoneNumber = phoneNumber;
        }
 
-       @Override
-       @Deprecated
-       public Integer getPhoneAreaCode () {
-               throw new UnsupportedOperationException("Cellphone numbers don't have area codes. Please fix your code."); //NOI18N
-       }
-
-       @Override
-       @Deprecated
-       public void setPhoneAreaCode (final Integer phoneAreaCode) {
-               throw new UnsupportedOperationException("Cellphone numbers don't have area codes. Please fix your code."); //NOI18N
-       }
-
-       @Override
-       public int compareTo (final DialableCellphoneNumber dialableCellphoneNumber) {
-               throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
-       }
-
-       @Override
-       public int hashCode () {
-               int hash = 5;
-               hash = 97 * hash + Objects.hashCode(this.getCellphoneProvider());
-               hash = 97 * hash + Objects.hashCode(this.getPhoneNumber());
-               return hash;
-       }
 }
index d74cacf8c2ec5892a06a39b9a23ca45dff591fcb..f4b87a7e175a6c0e9342fcf0c69a9e91ca3b0487 100644 (file)
@@ -48,6 +48,20 @@ public class FaxNumber implements DialableFaxNumber, Comparable<DialableFaxNumbe
         */
        private static final long serialVersionUID = 17_687_687_191_375L;
 
+       /**
+        * Area code (example: 2151 for Krefeld)
+        */
+       @Basic (optional = false)
+       @Column (name = "fax_area_code", length = 10, nullable = false)
+       private Integer faxAreaCode;
+
+       /**
+        * Country instance ('s dial data)
+        */
+       @JoinColumn (name = "fax_country_id", nullable = false)
+       @OneToOne (targetEntity = CountryData.class, cascade = CascadeType.MERGE, optional = false, fetch = FetchType.EAGER)
+       private Country faxCountry;
+
        /**
         * Timestamp when this entry has been created
         */
@@ -71,20 +85,6 @@ public class FaxNumber implements DialableFaxNumber, Comparable<DialableFaxNumbe
        @Column (name = "fax_number", length = 20, nullable = false)
        private Long phoneNumber;
 
-       /**
-        * Area code (example: 2151 for Krefeld)
-        */
-       @Basic (optional = false)
-       @Column (name = "fax_area_code", length = 10, nullable = false)
-       private Integer faxAreaCode;
-
-       /**
-        * Country instance ('s dial data)
-        */
-       @JoinColumn (name = "fax_country_id", nullable = false)
-       @OneToOne (targetEntity = CountryData.class, cascade = CascadeType.MERGE, optional = false, fetch = FetchType.EAGER)
-       private Country faxCountry;
-
        /**
         * Contructor with country, area code and number
         * <p>
@@ -107,23 +107,38 @@ public class FaxNumber implements DialableFaxNumber, Comparable<DialableFaxNumbe
        }
 
        @Override
-       public Long getPhoneId () {
-               return this.phoneId;
+       public int compareTo (final DialableFaxNumber dialableFaxNumber) {
+               throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
        }
 
        @Override
-       public void setPhoneId (final Long phoneId) {
-               this.phoneId = phoneId;
-       }
+       public boolean equals (final Object object) {
+               if (object == null) {
+                       return false;
+               } else if (this.getClass() != object.getClass()) {
+                       return false;
+               }
 
-       @Override
-       public Long getPhoneNumber () {
-               return this.phoneNumber;
+               final DialableFaxNumber other = (DialableFaxNumber) object;
+
+               if (!Objects.equals(this.getPhoneNumber(), other.getPhoneNumber())) {
+                       return false;
+               } else if (!Objects.equals(this.getPhoneAreaCode(), other.getPhoneAreaCode())) {
+                       return false;
+               } else if (!Objects.equals(this.getPhoneCountry(), other.getPhoneCountry())) {
+                       return false;
+               }
+
+               return true;
        }
 
        @Override
-       public void setPhoneNumber (final Long phoneNumber) {
-               this.phoneNumber = phoneNumber;
+       public int hashCode () {
+               int hash = 3;
+               hash = 23 * hash + Objects.hashCode(this.getPhoneNumber());
+               hash = 23 * hash + Objects.hashCode(this.getPhoneAreaCode());
+               hash = 23 * hash + Objects.hashCode(this.getPhoneCountry());
+               return hash;
        }
 
        @Override
@@ -157,38 +172,23 @@ public class FaxNumber implements DialableFaxNumber, Comparable<DialableFaxNumbe
        }
 
        @Override
-       public int compareTo (final DialableFaxNumber dialableFaxNumber) {
-               throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
+       public Long getPhoneId () {
+               return this.phoneId;
        }
 
        @Override
-       public boolean equals (final Object object) {
-               if (object == null) {
-                       return false;
-               } else if (this.getClass() != object.getClass()) {
-                       return false;
-               }
-
-               final DialableFaxNumber other = (DialableFaxNumber) object;
-
-               if (!Objects.equals(this.getPhoneNumber(), other.getPhoneNumber())) {
-                       return false;
-               } else if (!Objects.equals(this.getPhoneAreaCode(), other.getPhoneAreaCode())) {
-                       return false;
-               } else if (!Objects.equals(this.getPhoneCountry(), other.getPhoneCountry())) {
-                       return false;
-               }
+       public void setPhoneId (final Long phoneId) {
+               this.phoneId = phoneId;
+       }
 
-               return true;
+       @Override
+       public Long getPhoneNumber () {
+               return this.phoneNumber;
        }
 
        @Override
-       public int hashCode () {
-               int hash = 3;
-               hash = 23 * hash + Objects.hashCode(this.getPhoneNumber());
-               hash = 23 * hash + Objects.hashCode(this.getPhoneAreaCode());
-               hash = 23 * hash + Objects.hashCode(this.getPhoneCountry());
-               return hash;
+       public void setPhoneNumber (final Long phoneNumber) {
+               this.phoneNumber = phoneNumber;
        }
 
 }
index 21734d26c19d0130023c1831b71ab864de370f0c..d0f3e55b2bb7283389b3495911f0951f9671b026 100644 (file)
@@ -54,12 +54,11 @@ public class CellphoneProvider implements SmsProvider, Comparable<SmsProvider> {
        private static final long serialVersionUID = 185_878_567_810_590L;
 
        /**
-        * Id number
+        * Country instance ('s dial data)
         */
-       @Id
-       @GeneratedValue (strategy = GenerationType.IDENTITY)
-       @Column (name = "provider_id", length = 20, nullable = false, updatable = false)
-       private Long providerId;
+       @JoinColumn (name = "provider_country_id", nullable = false)
+       @OneToOne (targetEntity = CountryData.class, cascade = CascadeType.MERGE, optional = false, fetch = FetchType.EAGER)
+       private Country providerCountry;
 
        /**
         * Provider dial prefix (example: 0177 for German E+)
@@ -68,20 +67,6 @@ public class CellphoneProvider implements SmsProvider, Comparable<SmsProvider> {
        @Column (name = "provider_dial_prefix", length = 10, nullable = false)
        private Long providerDialPrefix;
 
-       /**
-        * Name of the provider
-        */
-       @Basic (optional = false)
-       @Column (name = "provider_name", length = 30, nullable = false)
-       private String providerName;
-
-       /**
-        * Country instance ('s dial data)
-        */
-       @JoinColumn (name = "provider_country_id", nullable = false)
-       @OneToOne (targetEntity = CountryData.class, cascade = CascadeType.MERGE, optional = false, fetch = FetchType.EAGER)
-       private Country providerCountry;
-
        /**
         * Timestamp when this entry has been created
         */
@@ -91,10 +76,19 @@ public class CellphoneProvider implements SmsProvider, Comparable<SmsProvider> {
        private Calendar providerEntryCreated;
 
        /**
-        * Protected constructor for JPA
+        * Id number
         */
-       protected CellphoneProvider () {
-       }
+       @Id
+       @GeneratedValue (strategy = GenerationType.IDENTITY)
+       @Column (name = "provider_id", length = 20, nullable = false, updatable = false)
+       private Long providerId;
+
+       /**
+        * Name of the provider
+        */
+       @Basic (optional = false)
+       @Column (name = "provider_name", length = 30, nullable = false)
+       private String providerName;
 
        /**
         * Constructor with all required data
@@ -111,34 +105,45 @@ public class CellphoneProvider implements SmsProvider, Comparable<SmsProvider> {
                this.providerEntryCreated = providerEntryCreated;
        }
 
-       @Override
-       public Long getProviderId () {
-               return this.providerId;
+       /**
+        * Protected constructor for JPA
+        */
+       protected CellphoneProvider () {
        }
 
        @Override
-       public void setProviderId (final Long providerId) {
-               this.providerId = providerId;
+       public int compareTo (final SmsProvider provider) {
+               throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
        }
 
        @Override
-       public Long getProviderDialPrefix () {
-               return this.providerDialPrefix;
-       }
+       public boolean equals (final Object object) {
+               if (object == null) {
+                       return false;
+               } else if (this.getClass() != object.getClass()) {
+                       return false;
+               }
 
-       @Override
-       public void setProviderDialPrefix (final Long providerDialPrefix) {
-               this.providerDialPrefix = providerDialPrefix;
-       }
+               final SmsProvider other = (SmsProvider) object;
 
-       @Override
-       public String getProviderName () {
-               return this.providerName;
+               if (!Objects.equals(this.getProviderDialPrefix(), other.getProviderDialPrefix())) {
+                       return false;
+               } else if (!Objects.equals(this.getProviderName(), other.getProviderName())) {
+                       return false;
+               } else if (!Objects.equals(this.getProviderCountry(), other.getProviderCountry())) {
+                       return false;
+               }
+
+               return true;
        }
 
        @Override
-       public void setProviderName (final String providerName) {
-               this.providerName = providerName;
+       public int hashCode () {
+               int hash = 7;
+               hash = 19 * hash + Objects.hashCode(this.getProviderDialPrefix());
+               hash = 19 * hash + Objects.hashCode(this.getProviderName());
+               hash = 19 * hash + Objects.hashCode(this.getProviderCountry());
+               return hash;
        }
 
        @Override
@@ -151,6 +156,16 @@ public class CellphoneProvider implements SmsProvider, Comparable<SmsProvider> {
                this.providerCountry = providerCountry;
        }
 
+       @Override
+       public Long getProviderDialPrefix () {
+               return this.providerDialPrefix;
+       }
+
+       @Override
+       public void setProviderDialPrefix (final Long providerDialPrefix) {
+               this.providerDialPrefix = providerDialPrefix;
+       }
+
        @Override
        public Calendar getProviderEntryCreated () {
                return this.providerEntryCreated;
@@ -162,38 +177,23 @@ public class CellphoneProvider implements SmsProvider, Comparable<SmsProvider> {
        }
 
        @Override
-       public int compareTo (final SmsProvider provider) {
-               throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
+       public Long getProviderId () {
+               return this.providerId;
        }
 
        @Override
-       public boolean equals (final Object object) {
-               if (object == null) {
-                       return false;
-               } else if (this.getClass() != object.getClass()) {
-                       return false;
-               }
-
-               final SmsProvider other = (SmsProvider) object;
-
-               if (!Objects.equals(this.getProviderDialPrefix(), other.getProviderDialPrefix())) {
-                       return false;
-               } else if (!Objects.equals(this.getProviderName(), other.getProviderName())) {
-                       return false;
-               } else if (!Objects.equals(this.getProviderCountry(), other.getProviderCountry())) {
-                       return false;
-               }
+       public void setProviderId (final Long providerId) {
+               this.providerId = providerId;
+       }
 
-               return true;
+       @Override
+       public String getProviderName () {
+               return this.providerName;
        }
 
        @Override
-       public int hashCode () {
-               int hash = 7;
-               hash = 19 * hash + Objects.hashCode(this.getProviderDialPrefix());
-               hash = 19 * hash + Objects.hashCode(this.getProviderName());
-               hash = 19 * hash + Objects.hashCode(this.getProviderCountry());
-               return hash;
+       public void setProviderName (final String providerName) {
+               this.providerName = providerName;
        }
 
 }