From 5ac805a242e4746cf2b279ad906384780f73a727 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Thu, 22 Oct 2015 10:25:28 +0200 Subject: [PATCH] =?utf8?q?Continued:=20-=20added=20timestamps=20for=20admi?= =?utf8?q?nistrative=20purposes=20-=20added=20it=20to=20existing=20constru?= =?utf8?q?ctors=20-=20added=20constructor=20for=20cellphone=20provider=20+?= =?utf8?q?=20protected=20default=20-=20updated=20jar(s)=20Signed-off-by:Ro?= =?utf8?q?land=20H=C3=A4der=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- lib/jcountry-core.jar | Bin 6194 -> 6767 bytes .../jphone/phonenumbers/DialableNumber.java | 15 +++ .../cellphone/CellphoneNumber.java | 27 ++++- .../jphone/phonenumbers/fax/FaxNumber.java | 77 ++++++++++----- .../phonenumbers/landline/LandLineNumber.java | 77 ++++++++++----- .../smsprovider/CellphoneProvider.java | 92 +++++++++++++----- .../phonenumbers/smsprovider/SmsProvider.java | 15 +++ 7 files changed, 222 insertions(+), 81 deletions(-) diff --git a/lib/jcountry-core.jar b/lib/jcountry-core.jar index 234d3fbe4b8bfd5ad614a4b2509deb29ba454fef..28024eeb45e65d2334a4e91585545cbe4004aa66 100644 GIT binary patch literal 6767 zcmeHM-E$jP6+bJ>lC8*&zv3iLNz{DWacn20ZPF%9tH^dxW7&?a7?M)lwY0G|S??;V zRcaR~NlOcDffgtq1=>DPW?-hw@Y!_uDhv$mgco=K{sZ24;=RM~+`ZDS)@#)-Fg&1{ zy}S3`bI$#pd(ZvdqutqaEztx~8`0?bg|p=QwNsRG6Z!N=c6xH`{o6#dbb6xz^v z-{{>PiHxnOj#eBwv&QnrM~^PvdwgW+=&{t`jI9<7EtRqCvSq6dEDm)fIuahRpbt?1 zv+U)ujU_sy#L8-+q?*fG6Vd*l=#_$1H644ciO#MKb&9H^1{81K^WMMSX(8fku(@K! z9eK21sFlj?_kZylh<}(4#c6+>4#er8LcPnHBc*0b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P?T8To+1vuJ5Kjr%=neE_+zz#arTQ3*4o51u=CWh!a^$cK1FYKx4ld4e`;X! zf)6WJ$BI#&mVlwq4O*61exqWIM!g(p)EDVXbs|2aVvR<<3Zq{05sB1^M5J>m9Ipb1 z9B3r+dLWUf>6suR2O5d|7)0LKgNW;{3OyT0B;H8mCxJx1984tMNaSZA^7B22xM4t{ z)j%R0jYNJCNaVR-A{~uHegz`G-h+r6XcSTdiF7s+c@RisEtp7WBayd2p; z0u=++$iYS;4+Dv4bSr3$9Bd@=K8XBb4W(B_9yg!1nuIf7!_IJ(*LR=PnOzU3U`A2x=%}_H9oCe8@ zHU1$r>c>;fRQVX!y;yY+nJakb)eM7=bv=x^Ju!F-xXX^lW8NCnoA+O74kS0p?g3LH my~e{T5A_g^fPzgF^d#yesMe5MIlE%V)JCV^0{`mc+J68&a&puF diff --git a/src/org/mxchange/jphone/phonenumbers/DialableNumber.java b/src/org/mxchange/jphone/phonenumbers/DialableNumber.java index ca10dc7..9bbf1e1 100644 --- a/src/org/mxchange/jphone/phonenumbers/DialableNumber.java +++ b/src/org/mxchange/jphone/phonenumbers/DialableNumber.java @@ -17,6 +17,7 @@ package org.mxchange.jphone.phonenumbers; import java.io.Serializable; +import java.util.Calendar; import org.mxchange.jcountry.data.Country; /** @@ -81,4 +82,18 @@ public interface DialableNumber extends Serializable { * @param phoneAreaCode Area code without dial prefix */ void setPhoneAreaCode (final Integer phoneAreaCode); + + /** + * Getter for timestamp when this entry has been created + *

+ * @return Timestamp when this entry has been created + */ + Calendar getPhoneEntryCreated (); + + /** + * Setter for timestamp when this entry has been created + *

+ * @param phoneEntryCreated Timestamp when this entry has been created + */ + void setPhoneEntryCreated (final Calendar phoneEntryCreated); } diff --git a/src/org/mxchange/jphone/phonenumbers/cellphone/CellphoneNumber.java b/src/org/mxchange/jphone/phonenumbers/cellphone/CellphoneNumber.java index c3e10b5..681d0c7 100644 --- a/src/org/mxchange/jphone/phonenumbers/cellphone/CellphoneNumber.java +++ b/src/org/mxchange/jphone/phonenumbers/cellphone/CellphoneNumber.java @@ -16,6 +16,7 @@ */ package org.mxchange.jphone.phonenumbers.cellphone; +import java.util.Calendar; import java.util.Objects; import javax.persistence.Basic; import javax.persistence.CascadeType; @@ -28,6 +29,8 @@ import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.OneToOne; import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; import org.mxchange.jcountry.data.Country; import org.mxchange.jphone.phonenumbers.smsprovider.CellphoneProvider; import org.mxchange.jphone.phonenumbers.smsprovider.SmsProvider; @@ -58,7 +61,7 @@ public class CellphoneNumber implements DialableCellphoneNumber, Comparable * @param cellphoneCarrier Cellphone carrier instance * @param cellphoneNumber Cellphone number + * @param phoneEntryCreated When this entry has been created */ - public CellphoneNumber (final SmsProvider cellphoneCarrier, final Long cellphoneNumber) { + public CellphoneNumber (final SmsProvider cellphoneCarrier, final Long cellphoneNumber, final Calendar phoneEntryCreated) { this.cellphoneProvider = cellphoneCarrier; this.phoneNumber = cellphoneNumber; + this.phoneEntryCreated = phoneEntryCreated; } /** @@ -116,6 +129,16 @@ public class CellphoneNumber implements DialableCellphoneNumber, Comparable { @OneToOne (targetEntity = CountryData.class, cascade = CascadeType.ALL, optional = false, fetch = FetchType.EAGER) private Country providerCountry; - @Override - public int compareTo (final SmsProvider provider) { - 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) { - return false; - } else if (getClass() != object.getClass()) { - return false; - } - - final SmsProvider other = (SmsProvider) object; + /** + * Timestamp when this entry has been created + */ + @Basic (optional = false) + @Temporal (TemporalType.TIMESTAMP) + @Column (name = "provider_entry_created", nullable = false, updatable = false) + private Calendar providerEntryCreated; - 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; - } + /** + * Protected constructor for JPA + */ + protected CellphoneProvider () { + } - return true; + /** + * Constructor with all required data + *

+ * @param providerDialPrefix Dial prefix + * @param providerName Name + * @param providerCountry Country + * @param providerEntryCreated When this entry has been created + */ + public CellphoneProvider (final Long providerDialPrefix, final String providerName, final Country providerCountry, final Calendar providerEntryCreated) { + this.providerDialPrefix = providerDialPrefix; + this.providerName = providerName; + this.providerCountry = providerCountry; + this.providerEntryCreated = providerEntryCreated; } @Override public Long getProviderId () { - return providerId; + return this.providerId; } @Override @@ -117,7 +123,7 @@ public class CellphoneProvider implements SmsProvider, Comparable { @Override public Long getProviderDialPrefix () { - return providerDialPrefix; + return this.providerDialPrefix; } @Override @@ -127,7 +133,7 @@ public class CellphoneProvider implements SmsProvider, Comparable { @Override public String getProviderName () { - return providerName; + return this.providerName; } @Override @@ -145,6 +151,42 @@ public class CellphoneProvider implements SmsProvider, Comparable { this.providerCountry = providerCountry; } + @Override + public Calendar getProviderEntryCreated () { + return this.providerEntryCreated; + } + + @Override + public void setProviderEntryCreated (final Calendar providerEntryCreated) { + this.providerEntryCreated = providerEntryCreated; + } + + @Override + public int compareTo (final SmsProvider provider) { + 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) { + return false; + } else if (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; + } + + return true; + } + @Override public int hashCode () { int hash = 7; diff --git a/src/org/mxchange/jphone/phonenumbers/smsprovider/SmsProvider.java b/src/org/mxchange/jphone/phonenumbers/smsprovider/SmsProvider.java index 7d13a26..a9e1e04 100644 --- a/src/org/mxchange/jphone/phonenumbers/smsprovider/SmsProvider.java +++ b/src/org/mxchange/jphone/phonenumbers/smsprovider/SmsProvider.java @@ -17,6 +17,7 @@ package org.mxchange.jphone.phonenumbers.smsprovider; import java.io.Serializable; +import java.util.Calendar; import org.mxchange.jcountry.data.Country; /** @@ -82,6 +83,20 @@ public interface SmsProvider extends Serializable { */ void setProviderCountry (final Country country); + /** + * Getter for timestamp when this entry has been created + *

+ * @return Timestamp when this entry has been created + */ + Calendar getProviderEntryCreated (); + + /** + * Setter for timestamp when this entry has been created + *

+ * @param providerEntryCreated Timestamp when this entry has been created + */ + void setProviderEntryCreated (final Calendar providerEntryCreated); + @Override boolean equals (final Object object); -- 2.39.5