* <p>
* @return "created" timestamp
*/
- Date getContactCreated ();
+ Date getContactEntryCreated ();
/**
* Setter for "created" timestamp
* <p>
- * @param created "created" timestamp
+ * @param contactEntryCreated "created" timestamp
*/
- void setContactCreated (final Date created);
+ void setContactEntryCreated (final Date contactEntryCreated);
+
+ /**
+ * Getter for "updated" timestamp
+ * <p>
+ * @return "updated" timestamp
+ */
+ Date getContactEntryUpdated ();
+
+ /**
+ * Getter for "updated" timestamp
+ * <p>
+ * @param contactEntryUpdated "updated" timestamp
+ */
+ void setContactEntryUpdated (final Date contactEntryUpdated);
/**
* Email address
*/
void setContactTitle (final String contactTitle);
- /**
- * Getter for "updated" timestamp
- * <p>
- * @return "updated" timestamp
- */
- Date getContactUpdated ();
-
- /**
- * Getter for "updated" timestamp
- * <p>
- * @param updated "updated" timestamp
- */
- void setContactUpdated (final Date updated);
-
/**
* ZIP code
* <p>
// - other data
targetContact.setContactBirthday(sourceContact.getContactBirthday());
targetContact.setContactComment(sourceContact.getContactComment());
- targetContact.setContactUpdated(sourceContact.getContactUpdated());
+ targetContact.setContactEntryUpdated(sourceContact.getContactEntryUpdated());
}
/**
}
} else if ((faxCountry instanceof Country) && (faxAreaCode > 0) && (faxNumber > 0)) {
// Set new land-line number
- DialableFaxNumber fax = new FaxNumber(faxCountry, faxAreaCode, faxNumber);
+ final DialableFaxNumber fax = new FaxNumber(faxCountry, faxAreaCode, faxNumber);
// Set it in contact
contact.setContactFaxNumber(fax);
}
} else if ((phoneCountry instanceof Country) && (phoneAreaCode > 0) && (phoneNumber > 0)) {
// Set new land-line number
- DialableLandLineNumber landLine = new LandLineNumber(phoneCountry, phoneAreaCode, phoneNumber);
+ final DialableLandLineNumber landLine = new LandLineNumber(phoneCountry, phoneAreaCode, phoneNumber);
// Set it in contact
contact.setContactLandLineNumber(landLine);
}
} else if ((mobileProvider instanceof MobileProvider) && (mobileNumber > 0)) {
// Create new instance
- DialableMobileNumber mobile = new MobileNumber(mobileProvider, mobileNumber);
+ final DialableMobileNumber mobile = new MobileNumber(mobileProvider, mobileNumber);
// Set it in contact
contact.setContactMobileNumber(mobile);
@OneToOne (targetEntity = CountryData.class, cascade = CascadeType.REFRESH, optional = false)
private Country contactCountry;
+ /**
+ * Email address
+ */
+ @Column (name = "contact_email_address", length = 100, unique = true)
+ private String contactEmailAddress;
+
/**
* When the contact has been created
*/
@Basic (optional = false)
@Temporal (TemporalType.TIMESTAMP)
- @Column (name = "contact_created", nullable = false)
- private Date contactCreated;
+ @Column (name = "contact_entry_created", nullable = false)
+ private Date contactEntryCreated;
/**
- * Email address
+ * When the contact has been updated
*/
- @Column (name = "contact_email_address", length = 100, unique = true)
- private String contactEmailAddress;
+ @Temporal (TemporalType.TIMESTAMP)
+ @Column (name = "contact_entry_updated")
+ private Date contactEntryUpdated;
/**
* Family name
@Column (name = "contact_title")
private String contactTitle;
- /**
- * When the contact has been updated
- */
- @Temporal (TemporalType.TIMESTAMP)
- @Column (name = "contact_updated")
- private Date contactUpdated;
-
/**
* ZIP code
*/
/**
* Constructor for title and names
* <p>
- * @param contactTitle Personal title
- * @param contactFirstName First name
- * @param contactFamilyName Family name
+ * @param contactPersonalTitle Personal title
+ * @param contactFirstName First name
+ * @param contactFamilyName Family name
*/
- public UserContact (final PersonalTitle contactTitle, final String contactFirstName, final String contactFamilyName) {
- // Call default constructor
+ public UserContact (final PersonalTitle contactPersonalTitle, final String contactFirstName, final String contactFamilyName) {
+ // Invoke default constructor
this();
+ // Are all parameter set?
+ if (null == contactFamilyName) {
+ // Throw NPE
+ throw new NullPointerException("contactFamilyName is null"); //NOI18N
+ } else if (contactFamilyName.isEmpty()) {
+ // Throw IAE
+ throw new IllegalArgumentException("contactFamilyName is empty"); //NOI18N
+ } else if (null == contactFirstName) {
+ // Throw NPE
+ throw new NullPointerException("contactFirstName is null"); //NOI18N
+ } else if (contactFirstName.isEmpty()) {
+ // Throw IAE
+ throw new IllegalArgumentException("contactFirstName is empty"); //NOI18N
+ } else if (null == contactPersonalTitle) {
+ // Throw NPE
+ throw new NullPointerException("contactPersonalTitle is null"); //NOI18N
+ }
+
// Set all
- this.contactPersonalTitle = contactTitle;
+ this.contactPersonalTitle = contactPersonalTitle;
this.contactFirstName = contactFirstName;
this.contactFamilyName = contactFamilyName;
}
this.contactCountry = contactCountry;
}
+ @Override
+ public String getContactEmailAddress () {
+ return this.contactEmailAddress;
+ }
+
+ @Override
+ public void setContactEmailAddress (final String contactEmailAddress) {
+ this.contactEmailAddress = contactEmailAddress;
+ }
+
@Override
@SuppressWarnings ("ReturnOfDateField")
- public Date getContactCreated () {
- return this.contactCreated;
+ public Date getContactEntryCreated () {
+ return this.contactEntryCreated;
}
@Override
@SuppressWarnings ("AssignmentToDateFieldFromParameter")
- public void setContactCreated (final Date contactCreated) {
- this.contactCreated = contactCreated;
+ public void setContactEntryCreated (final Date contactEntryCreated) {
+ this.contactEntryCreated = contactEntryCreated;
}
@Override
- public String getContactEmailAddress () {
- return this.contactEmailAddress;
+ @SuppressWarnings ("ReturnOfDateField")
+ public Date getContactEntryUpdated () {
+ return this.contactEntryUpdated;
}
@Override
- public void setContactEmailAddress (final String contactEmailAddress) {
- this.contactEmailAddress = contactEmailAddress;
+ @SuppressWarnings ("AssignmentToDateFieldFromParameter")
+ public void setContactEntryUpdated (final Date contactEntryUpdated) {
+ this.contactEntryUpdated = contactEntryUpdated;
}
@Override
this.contactTitle = contactTitle;
}
- @Override
- @SuppressWarnings ("ReturnOfDateField")
- public Date getContactUpdated () {
- return this.contactUpdated;
- }
-
- @Override
- @SuppressWarnings ("AssignmentToDateFieldFromParameter")
- public void setContactUpdated (final Date contactUpdated) {
- this.contactUpdated = contactUpdated;
- }
-
@Override
public Integer getContactZipCode () {
return this.contactZipCode;