From 24c4a3aef7e2de8b4823cd212d803b76e781f5ac Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Sat, 10 Oct 2015 22:02:50 +0200 Subject: [PATCH] Rewrite: - introduced jcountry-core which is a library for handling country-related data, e.g. dial prefix, country code ... - introduced jphone-core which is a library for handling phone, fax and cell phone numbers - these both new libraries required a rewrite of many parts --- .gitignore | 8 +- lib/jcore.jar | Bin 13656 -> 13656 bytes lib/jcountry-core.jar | Bin 0 -> 5394 bytes lib/jphone-core.jar | Bin 0 -> 14657 bytes nbproject/build-impl.xml | 2832 ++++++++--------- nbproject/project.properties | 6 + nbproject/project.xml | 30 +- .../mxchange/jcontacts/contact/Contact.java | 38 +- .../jcontacts/contact/UserContact.java | 64 +- 9 files changed, 1508 insertions(+), 1470 deletions(-) create mode 100644 lib/jcountry-core.jar create mode 100644 lib/jphone-core.jar diff --git a/.gitignore b/.gitignore index 315ea15..0383bcc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ -/dist/ +/nbproject/private/ +/nbproject/*~ +/manifest.mf /build/ -/nbproject/private/ \ No newline at end of file +/dist/ +/data/* +/*.properties diff --git a/lib/jcore.jar b/lib/jcore.jar index 57a3b6cecdc73685710c2cf6d6760b52b39a09d7..1a75fc00ef1f570f9b3af2edf1b0065404ef10eb 100644 GIT binary patch delta 415 zcmcbSbt8*6z?+$ci-CcIfq{Fy*F;_oW-cIQF`pU4yCn~%{%C-x$?A-HU^;@)3QTh{ zsZ2ItVV`_}kqgW}%V-G|HwDvUxZto@SqRIte8EL{tb zk0vkGwFgN|ey*zzrX}?(z;uY79hjb~=LM!8>A8YwEqzZgU8WD=@6&e!^Vto8z;uj3 zIGEmM5C*3C4Wq$yu3UxZto@SqRIte8EL{tb zk0vkGwFgN|ey*zzrX}?(z;uY79hjb~=LM!8>A8YwEqzZgU8WD=@6&e!^Vto8z;uj3 zIGEmM5C*3C4Wq$yu3cNqV7mnkG&tl-|K{lj1fvnl#WtF&lf5Y`fWY*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6K2;&2Ye864bPrf6{f5QkUS?ywiP+pTy4h(jB`()2<*bl~RGNjn3+ zq=bk$ws&BAA8y}tW}p+pPCTdVD#32plZ8I$zlv)1Q4yj^O8kCoJ%RTJ>46kDL;^`i zVBjhoMhF^23iQ+pglL2#Brt>z&}0o@sR|5@Dq(wSwKb8pQGz|`3?HJ^mDnJvPkX4! zx#40p;Beg0+l~-)9xP9xp;A~gtXmF00QN23gy1xmVbQr4&ftCA0l-;!7F!ISgEW@4 z!uKHbjZat&6dr?&6h4bXg=nb5gWp5Q9a<5+OL)v&78<%8lpLO@Id);>aaCPS0;T*2 zO;R|9ZWTh_GBKIKdpHwk$QWxN2m566jVgIDcIH_A6 zBH=2Lu=HaFlQ0!PB;qG>JCMjU%mfjM_=&uZMBb=F#0d}vvw=jSej;xL5_ut*NYqc{ z9VGH@9U@NPF}M^+B<3gbejt&#U?MR;kq?o`M|Freq0L}Ekci?Z@^K)M%fUnxKao$6 z$ftFPILU*-0=yXDBdvZSp9KGw_WvOv88*F^oQ$m5jNbEp>c;cKAEo7syj)YVk~vlhzZ)ds(( zsjhyxaz1joqCuazNPw=pcLuSnih4eJH5!~gLpc`>{wvI-`# zQTj~fTqN3yi92||ZKQ)fTe&)>>*}B*$cB0NKVwx?-M#a6V@2{HG@yhU9FGM eyunix^t{I_@wsgFVoR8$qxd_7{`jbaT7Lrx@v2+^ literal 0 HcmV?d00001 diff --git a/lib/jphone-core.jar b/lib/jphone-core.jar new file mode 100644 index 0000000000000000000000000000000000000000..480f9f8edebf04e4b9fe061fdeb991e5fe3849ea GIT binary patch literal 14657 zcmds8S!`Ta8UF8hxt{TOiR~oK(qximv6I^4G>MxyOYL|`y}PmF5_fTL#y8HC@f~Ys z93_YcDj{BY=mSDRAV5VGs6Y!;rA0+74?GnWUXTz%P^nKy2=UHC#rL0ccb}QLlQ^wl zq{u4W>@@^|vI3E#H&j4I^{g zOyL=RJl{9ak{BtNM#)_5y>gG+pX=*i85rozS|zh!8M)q@{ijmha|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{X$oG}L$!xx8FV6DXm0+I-%}D}fpi z4=!8(DoO=hv=|cw5FX|-P{Lz%)Yq}N&8m(jK^j8^WLmt>xKLsiD#G>WfY9WJAe8vQ zAEv(Ycq0*CqadxiB>0ctxP?;Z07eK%3?|^(r{gf?8NQw6+kj3_>U2)0^U-tPH(Cd^ zI|s1&?VQ^A)Xz{w*@ta*vU!vGQAEr;pnIyv^5M8mcRBa?&+bn~#BP7}&RT zEA`<5%T^DUSXbo_?(vHb_fUd+%&hYH3v6fcxyRNd0u^r9;=-wl2b+n?5M4ds`)9ZB za2-w?G>9mri(R`W9Ato{#7e`vdEPD_@7lHF`3_tiXxmxDLbP)NyLh{oIdtkdJz6v93BSDyRsn{(%Bd!mFMB zHO%kspG@TcQ9M%BKT?>0U$4KyoAoZK@Bb@@d90U_Y5lW<)V&!u?<$D@bxcDVb-Uzx0P$g;MlTV(s(?|qrkmhtPlGN~78&B$! zoe`ueE5d4Ph7YTFl3v1mt=d19H13>4P)i6`bUX>)el&sv*NYtk2KQ^!GQ%|xPv%Dl zYLOX5Rv2b_vi^ZmTvZGDXOrt24xCW;E}Tku67TfaDA6BQ#lOYory2m4342YQ^do%w I(i8mczs@C64FCWD literal 0 HcmV?d00001 diff --git a/nbproject/build-impl.xml b/nbproject/build-impl.xml index 48a76ad..032b3c2 100644 --- a/nbproject/build-impl.xml +++ b/nbproject/build-impl.xml @@ -18,1421 +18,1421 @@ is divided into following sections: - applet - cleanup ---> + --> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Must set src.dir - Must set test.src.dir - Must set build.dir - Must set dist.dir - Must set build.classes.dir - Must set dist.javadoc.dir - Must set build.test.classes.dir - Must set build.test.results.dir - Must set build.classes.excludes - Must set dist.jar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Must set javac.includes - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - No tests executed. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Must set JVM to use for profiling in profiler.info.jvm - Must set profiler agent JVM arguments in profiler.info.jvmargs.agent - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Must select some files in the IDE or set javac.includes - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - To run this application from the command line without Ant, try: - - java -jar "${dist.jar.resolved}" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Must select one file in the IDE or set run.class - - - - Must select one file in the IDE or set run.class - - - - - - - - - - - - - - - - - - - - - - - Must select one file in the IDE or set debug.class - - - - - Must select one file in the IDE or set debug.class - - - - - Must set fix.includes - - - - - - - - - - This target only works when run from inside the NetBeans IDE. - - - - - - - - - Must select one file in the IDE or set profile.class - This target only works when run from inside the NetBeans IDE. - - - - - - - - - This target only works when run from inside the NetBeans IDE. - - - - - - - - - - - - - This target only works when run from inside the NetBeans IDE. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Must select one file in the IDE or set run.class - - - - - - Must select some files in the IDE or set test.includes - - - - - Must select one file in the IDE or set run.class - - - - - Must select one file in the IDE or set applet.url - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Must select some files in the IDE or set javac.includes - - - - - - - - - - - - - - - - - - - - Some tests failed; see details above. - - - - - - - - - Must select some files in the IDE or set test.includes - - - - Some tests failed; see details above. - - - - Must select some files in the IDE or set test.class - Must select some method in the IDE or set test.method - - - - Some tests failed; see details above. - - - - - Must select one file in the IDE or set test.class - - - - Must select one file in the IDE or set test.class - Must select some method in the IDE or set test.method - - - - - - - - - - - - - - Must select one file in the IDE or set applet.url - - - - - - - - - Must select one file in the IDE or set applet.url - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set test.src.dir + Must set build.dir + Must set dist.dir + Must set build.classes.dir + Must set dist.javadoc.dir + Must set build.test.classes.dir + Must set build.test.results.dir + Must set build.classes.excludes + Must set dist.jar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + No tests executed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set JVM to use for profiling in profiler.info.jvm + Must set profiler agent JVM arguments in profiler.info.jvmargs.agent + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + To run this application from the command line without Ant, try: + + java -jar "${dist.jar.resolved}" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set run.class + + + + Must select one file in the IDE or set run.class + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set debug.class + + + + + Must select one file in the IDE or set debug.class + + + + + Must set fix.includes + + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + Must select one file in the IDE or set profile.class + This target only works when run from inside the NetBeans IDE. + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set run.class + + + + + + Must select some files in the IDE or set test.includes + + + + + Must select one file in the IDE or set run.class + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + Some tests failed; see details above. + + + + + + + + + Must select some files in the IDE or set test.includes + + + + Some tests failed; see details above. + + + + Must select some files in the IDE or set test.class + Must select some method in the IDE or set test.method + + + + Some tests failed; see details above. + + + + + Must select one file in the IDE or set test.class + + + + Must select one file in the IDE or set test.class + Must select some method in the IDE or set test.method + + + + + + + + + + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nbproject/project.properties b/nbproject/project.properties index d3eff02..7c117d2 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -31,12 +31,16 @@ dist.javadoc.dir=${dist.dir}/javadoc endorsed.classpath= excludes= file.reference.jcore.jar=lib/jcore.jar +file.reference.jcountry-core.jar=lib/jcountry-core.jar +file.reference.jphone-core.jar=lib/jphone-core.jar includes=** jar.archive.disabled=${jnlp.enabled} jar.compress=false jar.index=${jnlp.enabled} javac.classpath=\ ${file.reference.jcore.jar}:\ + ${file.reference.jcountry-core.jar}:\ + ${file.reference.jphone-core.jar}:\ ${libs.jpa20-persistence.classpath} # Space-separated list of extra javac options javac.compilerargs=-Xlint:unchecked -Xlint:deprecation @@ -90,5 +94,7 @@ run.test.classpath=\ ${build.test.classes.dir} source.encoding=UTF-8 source.reference.jcore.jar=../jcore/src/ +source.reference.jcountry-core.jar=../jcountry-core/src/ +source.reference.jphone-core.jar=../jphone-core/src/ src.dir=src test.src.dir=test diff --git a/nbproject/project.xml b/nbproject/project.xml index 7e13b08..8a8b12e 100644 --- a/nbproject/project.xml +++ b/nbproject/project.xml @@ -1,18 +1,18 @@ - org.netbeans.modules.java.j2seproject - - - jcontacts-core - - - - - - - - - .\lib\nblibraries.properties - - + org.netbeans.modules.java.j2seproject + + + jcontacts-core + + + + + + + + + .\lib\nblibraries.properties + + diff --git a/src/org/mxchange/jcontacts/contact/Contact.java b/src/org/mxchange/jcontacts/contact/Contact.java index 1ecef44..9eb87a1 100644 --- a/src/org/mxchange/jcontacts/contact/Contact.java +++ b/src/org/mxchange/jcontacts/contact/Contact.java @@ -20,6 +20,10 @@ import java.io.Serializable; import java.util.Calendar; import java.util.Date; import org.mxchange.jcontacts.contact.gender.Gender; +import org.mxchange.jcountry.data.Country; +import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber; +import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber; +import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber; /** * A general contact interface @@ -50,18 +54,18 @@ public interface Contact extends Serializable { public void setBirthday (final Date birthday); /** - * Cellphone number + * Getter for cellphone number *

- * @return the cellphoneNumber + * @return Cellphone number */ - public String getCellphoneNumber (); + public DialableCellphoneNumber getCellphoneNumber (); /** - * Cellphone number + * Setter for cellphone number *

- * @param cellphoneNumber the cellphoneNumber to set + * @param cellphoneNumber Cellphone number */ - public void setCellphoneNumber (final String cellphoneNumber); + public void setCellphoneNumber (final DialableCellphoneNumber cellphoneNumber); /** * City @@ -110,14 +114,14 @@ public interface Contact extends Serializable { *

* @return the countryCode */ - public String getCountryCode (); + public Country getCountry (); /** * Country code *

- * @param countryCode the countryCode to set + * @param contactCountry the countryCode to set */ - public void setCountryCode (final String countryCode); + public void setCountry (final Country contactCountry); /** * Getter for "created" timestamp @@ -166,14 +170,14 @@ public interface Contact extends Serializable { *

* @return the faxNumber */ - public String getFaxNumber (); + public DialableFaxNumber getFaxNumber (); /** * Fax number *

* @param faxNumber the faxNumber to set */ - public void setFaxNumber (final String faxNumber); + public void setFaxNumber (final DialableFaxNumber faxNumber); /** * First name @@ -225,18 +229,18 @@ public interface Contact extends Serializable { public void setOwnContact (final Boolean ownContact); /** - * Phone number + * Getter for phone number *

- * @return the phoneNumber + * @return Phone number */ - public String getPhoneNumber (); + public DialableLandLineNumber getPhoneNumber (); /** - * Phone number + * Setter for phone number *

- * @param phoneNumber the phoneNumber to set + * @param phoneNumber Phone number */ - public void setPhoneNumber (final String phoneNumber); + public void setPhoneNumber (final DialableLandLineNumber phoneNumber); /** * Street diff --git a/src/org/mxchange/jcontacts/contact/UserContact.java b/src/org/mxchange/jcontacts/contact/UserContact.java index bfb6ab6..b48a2e0 100644 --- a/src/org/mxchange/jcontacts/contact/UserContact.java +++ b/src/org/mxchange/jcontacts/contact/UserContact.java @@ -21,6 +21,7 @@ import java.util.Date; import java.util.Objects; import javax.annotation.PostConstruct; import javax.persistence.Basic; +import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.EnumType; @@ -28,11 +29,22 @@ import javax.persistence.Enumerated; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; +import javax.persistence.Index; +import javax.persistence.JoinColumn; import javax.persistence.Lob; +import javax.persistence.OneToOne; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; import org.mxchange.jcontacts.contact.gender.Gender; +import org.mxchange.jcountry.data.Country; +import org.mxchange.jcountry.data.CountryData; +import org.mxchange.jphone.phonenumbers.cellphone.CellphoneNumber; +import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber; +import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber; +import org.mxchange.jphone.phonenumbers.fax.FaxNumber; +import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber; +import org.mxchange.jphone.phonenumbers.landline.LandLineNumber; /** * A general contact class which should only be extended. @@ -41,7 +53,15 @@ import org.mxchange.jcontacts.contact.gender.Gender; * @version 0.0 */ @Entity (name = "contacts") -@Table (name = "contacts") +@Table ( + name = "contacts", + indexes = { + @Index ( + name = "gender", + columnList = "gender" + ) + } +) public class UserContact implements Contact, Comparable { /** @@ -59,8 +79,9 @@ public class UserContact implements Contact, Comparable { /** * Cellphone number */ - @Column (name = "cellphone_number", length = 100) - private String cellphoneNumber; + @JoinColumn (name = "cellphone_number_id") + @OneToOne (targetEntity = CellphoneNumber.class, cascade = CascadeType.ALL) + private DialableCellphoneNumber cellphoneNumber; /** * City @@ -86,8 +107,9 @@ public class UserContact implements Contact, Comparable { /** * Country code */ - @Column (name = "country_code", length = 2, nullable = false) - private String countryCode; + @JoinColumn (name = "contact_country_id", nullable = false) + @OneToOne(targetEntity = CountryData.class, cascade = CascadeType.ALL, optional = false) + private Country country; /** * When the contact has been created @@ -113,8 +135,9 @@ public class UserContact implements Contact, Comparable { /** * Fax number */ - @Column (name = "fax_number", length = 100) - private String faxNumber; + @JoinColumn (name = "fax_number_id") + @OneToOne(targetEntity = FaxNumber.class,cascade = CascadeType.ALL) + private DialableFaxNumber faxNumber; /** * First name @@ -146,8 +169,9 @@ public class UserContact implements Contact, Comparable { /** * Phone number */ - @Column (name = "phone_number", length = 100) - private String phoneNumber; + @JoinColumn (name = "phone_number_id") + @OneToOne (targetEntity = LandLineNumber.class, cascade = CascadeType.ALL) + private DialableLandLineNumber phoneNumber; /** * Street @@ -224,7 +248,7 @@ public class UserContact implements Contact, Comparable { this.setStreet(contact.getStreet()); this.setZipCode(contact.getZipCode()); this.setCity(contact.getCity()); - this.setCountryCode(contact.getCountryCode()); + this.setCountry(contact.getCountry()); // - phone, fax, email this.setPhoneNumber(contact.getPhoneNumber()); @@ -276,12 +300,12 @@ public class UserContact implements Contact, Comparable { } @Override - public String getCellphoneNumber () { + public DialableCellphoneNumber getCellphoneNumber () { return this.cellphoneNumber; } @Override - public void setCellphoneNumber (final String cellphoneNumber) { + public void setCellphoneNumber (final DialableCellphoneNumber cellphoneNumber) { this.cellphoneNumber = cellphoneNumber; } @@ -316,13 +340,13 @@ public class UserContact implements Contact, Comparable { } @Override - public String getCountryCode () { - return this.countryCode; + public Country getCountry () { + return this.country; } @Override - public void setCountryCode (final String countryCode) { - this.countryCode = countryCode; + public void setCountry (final Country country) { + this.country = country; } @Override @@ -357,12 +381,12 @@ public class UserContact implements Contact, Comparable { } @Override - public String getFaxNumber () { + public DialableFaxNumber getFaxNumber () { return this.faxNumber; } @Override - public void setFaxNumber (final String faxNumber) { + public void setFaxNumber (final DialableFaxNumber faxNumber) { this.faxNumber = faxNumber; } @@ -402,12 +426,12 @@ public class UserContact implements Contact, Comparable { } @Override - public String getPhoneNumber () { + public DialableLandLineNumber getPhoneNumber () { return this.phoneNumber; } @Override - public void setPhoneNumber (final String phoneNumber) { + public void setPhoneNumber (final DialableLandLineNumber phoneNumber) { this.phoneNumber = phoneNumber; } -- 2.39.5