]> git.mxchange.org Git - jphone-core.git/commitdiff
resorted members + added this.
authorRoland Haeder <roland@mxchange.org>
Sat, 20 Feb 2016 19:01:35 +0000 (20:01 +0100)
committerRoland Haeder <roland@mxchange.org>
Sat, 20 Feb 2016 19:01:35 +0000 (20:01 +0100)
src/org/mxchange/jphone/phonenumbers/landline/LandLineNumber.java

index 52485d784bb3b1a90020478c6c168189aee64610..2dd9d2039806152a40d5c8857af4d09edfc93c3d 100644 (file)
@@ -48,6 +48,20 @@ public class LandLineNumber implements DialableLandLineNumber, Comparable<Dialab
         */
        private static final long serialVersionUID = 18_563_748_781_956L;
 
+       /**
+        * Area code (example: 2151 for Krefeld)
+        */
+       @Basic (optional = false)
+       @Column (name = "phone_area_code", length = 10, nullable = false)
+       private Integer phoneAreaCode;
+
+       /**
+        * Connection to table "country_data"
+        */
+       @JoinColumn (name = "phone_country_id", nullable = false, updatable = false)
+       @OneToOne (targetEntity = CountryData.class, cascade = CascadeType.MERGE, optional = false, fetch = FetchType.EAGER)
+       private Country phoneCountry;
+
        /**
         * Timestamp when this entry has been created
         */
@@ -71,20 +85,6 @@ public class LandLineNumber implements DialableLandLineNumber, Comparable<Dialab
        @Column (name = "phone_number", length = 20, nullable = false)
        private Long phoneNumber;
 
-       /**
-        * Area code (example: 2151 for Krefeld)
-        */
-       @Basic (optional = false)
-       @Column (name = "phone_area_code", length = 10, nullable = false)
-       private Integer phoneAreaCode;
-
-       /**
-        * Connection to table "country_data"
-        */
-       @JoinColumn (name = "phone_country_id", nullable = false, updatable = false)
-       @OneToOne (targetEntity = CountryData.class, cascade = CascadeType.MERGE, optional = false, fetch = FetchType.EAGER)
-       private Country phoneCountry;
-
        /**
         * Counstructor with country instance, area code and number
         * <p>
@@ -107,23 +107,38 @@ public class LandLineNumber implements DialableLandLineNumber, Comparable<Dialab
        }
 
        @Override
-       public Long getPhoneId () {
-               return this.phoneId;
+       public int compareTo (final DialableLandLineNumber dialableNumber) {
+               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 (Object object) {
+               if (object == null) {
+                       return false;
+               } else if (this.getClass() != object.getClass()) {
+                       return false;
+               }
 
-       @Override
-       public Long getPhoneNumber () {
-               return this.phoneNumber;
+               final DialableLandLineNumber other = (DialableLandLineNumber) 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 = 7;
+               hash = 47 * hash + Objects.hashCode(this.getPhoneNumber());
+               hash = 47 * hash + Objects.hashCode(this.getPhoneAreaCode());
+               hash = 47 * hash + Objects.hashCode(this.getPhoneCountry());
+               return hash;
        }
 
        @Override
@@ -157,37 +172,21 @@ public class LandLineNumber implements DialableLandLineNumber, Comparable<Dialab
        }
 
        @Override
-       public int compareTo (final DialableLandLineNumber dialableNumber) {
-               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 (Object object) {
-               if (object == null) {
-                       return false;
-               } else if (getClass() != object.getClass()) {
-                       return false;
-               }
-
-               final DialableLandLineNumber other = (DialableLandLineNumber) 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;
+       public void setPhoneId (final Long phoneId) {
+               this.phoneId = phoneId;
        }
-
        @Override
-       public int hashCode () {
-               int hash = 7;
-               hash = 47 * hash + Objects.hashCode(this.getPhoneNumber());
-               hash = 47 * hash + Objects.hashCode(this.getPhoneAreaCode());
-               hash = 47 * hash + Objects.hashCode(this.getPhoneCountry());
-               return hash;
+       public Long getPhoneNumber () {
+               return this.phoneNumber;
+       }
+       @Override
+       public void setPhoneNumber (final Long phoneNumber) {
+               this.phoneNumber = phoneNumber;
        }
+
 }