From 588e806f4a8bbd4ac1373852bfde5f59fcd47227 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sun, 6 Aug 2017 23:17:02 +0200 Subject: [PATCH] fixed CRLF -> LF (Linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../jcontacts/contact/UserContact.java | 1034 ++++++++--------- .../contact/add/AdminAddedContactEvent.java | 132 +-- .../update/AdminUpdatedContactEvent.java | 132 +-- .../ObservableAdminUpdatedContactEvent.java | 74 +- 4 files changed, 686 insertions(+), 686 deletions(-) diff --git a/src/org/mxchange/jcontacts/contact/UserContact.java b/src/org/mxchange/jcontacts/contact/UserContact.java index a373519..3c2bd47 100644 --- a/src/org/mxchange/jcontacts/contact/UserContact.java +++ b/src/org/mxchange/jcontacts/contact/UserContact.java @@ -1,517 +1,517 @@ -/* - * Copyright (C) 2016, 2017 Roland Häder - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package org.mxchange.jcontacts.contact; - -import java.util.Calendar; -import java.util.Date; -import java.util.Objects; -import javax.persistence.Basic; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.EnumType; -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.NamedQueries; -import javax.persistence.NamedQuery; -import javax.persistence.OneToOne; -import javax.persistence.Table; -import javax.persistence.Temporal; -import javax.persistence.TemporalType; -import javax.persistence.Transient; -import org.mxchange.jcontacts.contact.title.PersonalTitle; -import org.mxchange.jcountry.data.Country; -import org.mxchange.jcountry.data.CountryData; -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; -import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber; -import org.mxchange.jphone.phonenumbers.mobile.MobileNumber; - -/** - * A general contact class which serves as an entity. - *

- * @author Roland Häder - * @version 0.0 - */ -@Entity (name = "contacts") -@Table ( - name = "contacts", - indexes = { - @Index ( - name = "contact_personal_title", - columnList = "contact_personal_title" - ) - } -) -@NamedQueries ( - { - @NamedQuery (name = "AllContacts", query = "SELECT c FROM contacts AS c ORDER BY c.contactId ASC"), - @NamedQuery (name = "AllContactEmailAddresses", query = "SELECT c.contactEmailAddress FROM contacts AS c ORDER BY c.contactId ASC"), - @NamedQuery (name = "AllContactsByCellphone", query = "SELECT c FROM contacts AS c WHERE c.contactMobileNumber = :mobileNumber ORDER BY c.contactId ASC"), - @NamedQuery (name = "SearchContactById", query = "SELECT c FROM contacts AS c WHERE c.contactId = :contactId"), - @NamedQuery (name = "SearchContactByEmailAddress", query = "SELECT c FROM contacts AS c WHERE LOWER(c.contactEmailAddress) LIKE LOWER(:emailAddress)") - } -) -@SuppressWarnings ("PersistenceUnitPresent") -public class UserContact implements Contact { - - /** - * Serial number - */ - @Transient - private static final long serialVersionUID = 58_744_284_981_863L; - - /** - * Birth day - */ - @Column (name = "contact_birthday") - @Temporal (TemporalType.DATE) - private Date contactBirthday; - - /** - * City - */ - @Column (name = "contact_city", length = 100) - private String contactCity; - - /** - * Optional comments - */ - @Lob - @Column (name = "contact_comment") - private String contactComment; - - /** - * Country code - */ - @JoinColumn (name = "contact_country_id", nullable = false, referencedColumnName = "country_id") - @OneToOne (targetEntity = CountryData.class, cascade = CascadeType.REFRESH, optional = false) - private Country contactCountry; - - /** - * When the contact has been created - */ - @Basic (optional = false) - @Temporal (TemporalType.TIMESTAMP) - @Column (name = "contact_created", nullable = false) - private Calendar contactCreated; - - /** - * Email address - */ - @Column (name = "contact_email_address", length = 100, unique = true) - private String contactEmailAddress; - - /** - * Family name - */ - @Basic (optional = false) - @Column (name = "contact_family_name", length = 100, nullable = false) - private String contactFamilyName; - - /** - * Fax number - */ - @JoinColumn (name = "contact_fax_number_id", referencedColumnName = "fax_id", unique = true) - @OneToOne (targetEntity = FaxNumber.class, cascade = CascadeType.ALL) - private DialableFaxNumber contactFaxNumber; - - /** - * First name - */ - @Basic (optional = false) - @Column (name = "contact_first_name", length = 100, nullable = false) - private String contactFirstName; - - /** - * House number - */ - @Column (name = "contact_house_number") - private Short contactHouseNumber; - - /** - * House number extension - */ - @Column (name = "contact_house_number_extension", length = 5) - private String contactHouseNumberExtension; - - /** - * Id number - */ - @Id - @GeneratedValue (strategy = GenerationType.IDENTITY) - @Column (name = "contact_id", nullable = false, updatable = false) - private Long contactId; - - /** - * Cellphone number - */ - @JoinColumn (name = "contact_mobile_number_id", referencedColumnName = "mobile_id", unique = true) - @OneToOne (targetEntity = MobileNumber.class, cascade = CascadeType.ALL) - private DialableMobileNumber contactMobileNumber; - - /** - * Flag whether this contact is user's own data - */ - @Basic (optional = false) - @Column (name = "contact_own_contact", nullable = false) - private Boolean contactOwnContact; - - /** - * Contact's personal title (Mr./Mrs.) - */ - @Basic (optional = false) - @Column (name = "contact_personal_title", nullable = false) - @Enumerated (EnumType.STRING) - private PersonalTitle contactPersonalTitle; - - /** - * Phone number - */ - @JoinColumn (name = "contact_landline_number_id", referencedColumnName = "landline_id", unique = true) - @OneToOne (targetEntity = LandLineNumber.class, cascade = CascadeType.ALL) - private DialableLandLineNumber contactPhoneNumber; - - /** - * Street - */ - @Column (name = "contact_street") - private String contactStreet; - - /** - * Title (Doctor, etc) - */ - @Column (name = "contact_title") - private String contactTitle; - - /** - * When the contact has been updated - */ - @Temporal (TemporalType.TIMESTAMP) - @Column (name = "contact_updated") - private Calendar contactUpdated; - - /** - * ZIP code - */ - @Column (name = "contact_zip_code") - private Integer contactZipCode; - - /** - * Default constructor - */ - public UserContact () { - // Default is not user's own contact - this.contactOwnContact = Boolean.FALSE; - } - - /** - * Constructor for title and names - *

- * @param contactTitle Personal title - * @param contactFirstName First name - * @param contactFamilyName Family name - */ - public UserContact (final PersonalTitle contactTitle, final String contactFirstName, final String contactFamilyName) { - // Call default constructor - this(); - - // Set all - this.contactPersonalTitle = contactTitle; - this.contactFirstName = contactFirstName; - this.contactFamilyName = contactFamilyName; - } - - @Override - public boolean equals (final Object object) { - if (this == object) { - return true; - } else if (null == object) { - return false; - } else if (this.getClass() != object.getClass()) { - return false; - } else if (!(object instanceof Contact)) { - // Not correct interface - return false; - } - - final Contact other = (Contact) object; - - if (!Objects.equals(this.getContactId(), other.getContactId())) { - return false; - } else if (!Objects.equals(this.getContactCity(), other.getContactCity())) { - return false; - } else if (!Objects.equals(this.getContactEmailAddress(), other.getContactEmailAddress())) { - return false; - } else if (!Objects.equals(this.getContactFamilyName(), other.getContactFamilyName())) { - return false; - } else if (!Objects.equals(this.getContactFirstName(), other.getContactFirstName())) { - return false; - } else if (!Objects.equals(this.getContactStreet(), other.getContactStreet())) { - return false; - } else if (!Objects.equals(this.getContactTitle(), other.getContactTitle())) { - return false; - } else if (!Objects.equals(this.getContactBirthday(), other.getContactBirthday())) { - return false; - } else if (!Objects.equals(this.getContactCountry(), other.getContactCountry())) { - return false; - } else if (this.getContactPersonalTitle() != other.getContactPersonalTitle()) { - return false; - } else if (!Objects.equals(this.getContactHouseNumber(), other.getContactHouseNumber())) { - return false; - } else if (!Objects.equals(this.getContactHouseNumberExtension(), other.getContactHouseNumberExtension())) { - return false; - } - - return true; - } - - @Override - @SuppressWarnings ("ReturnOfDateField") - public Date getContactBirthday () { - return this.contactBirthday; - } - - @Override - @SuppressWarnings ("AssignmentToDateFieldFromParameter") - public void setContactBirthday (final Date contactBirthday) { - this.contactBirthday = contactBirthday; - } - - @Override - public String getContactCity () { - return this.contactCity; - } - - @Override - public void setContactCity (final String contactCity) { - this.contactCity = contactCity; - } - - @Override - public String getContactComment () { - return this.contactComment; - } - - @Override - public void setContactComment (final String contactComment) { - this.contactComment = contactComment; - } - - @Override - public Country getContactCountry () { - return this.contactCountry; - } - - @Override - public void setContactCountry (final Country contactCountry) { - this.contactCountry = contactCountry; - } - - @Override - @SuppressWarnings ("ReturnOfDateField") - public Calendar getContactCreated () { - return this.contactCreated; - } - - @Override - @SuppressWarnings ("AssignmentToDateFieldFromParameter") - public void setContactCreated (final Calendar contactCreated) { - this.contactCreated = contactCreated; - } - - @Override - public String getContactEmailAddress () { - return this.contactEmailAddress; - } - - @Override - public void setContactEmailAddress (final String contactEmailAddress) { - this.contactEmailAddress = contactEmailAddress; - } - - @Override - public String getContactFamilyName () { - //* NOISY-DEBUG: */ this.getLogger().logTrace("CALLED!"); - return this.contactFamilyName; - } - - @Override - public void setContactFamilyName (final String contactFamilyName) { - this.contactFamilyName = contactFamilyName; - } - - @Override - public DialableFaxNumber getContactFaxNumber () { - return this.contactFaxNumber; - } - - @Override - public void setContactFaxNumber (final DialableFaxNumber contactFaxNumber) { - this.contactFaxNumber = contactFaxNumber; - } - - @Override - public String getContactFirstName () { - return this.contactFirstName; - } - - @Override - public void setContactFirstName (final String contactFirstName) { - this.contactFirstName = contactFirstName; - } - - @Override - public Short getContactHouseNumber () { - return this.contactHouseNumber; - } - - @Override - public void setContactHouseNumber (final Short contactHouseNumber) { - this.contactHouseNumber = contactHouseNumber; - } - - @Override - public String getContactHouseNumberExtension () { - return this.contactHouseNumberExtension; - } - - @Override - public void setContactHouseNumberExtension (final String contactHouseNumberExtension) { - this.contactHouseNumberExtension = contactHouseNumberExtension; - } - - @Override - public Long getContactId () { - return this.contactId; - } - - @Override - public void setContactId (final Long contactId) { - this.contactId = contactId; - } - - @Override - public DialableLandLineNumber getContactLandLineNumber () { - return this.contactPhoneNumber; - } - - @Override - public void setContactLandLineNumber (final DialableLandLineNumber contactPhoneNumber) { - this.contactPhoneNumber = contactPhoneNumber; - } - - @Override - public DialableMobileNumber getContactMobileNumber () { - return this.contactMobileNumber; - } - - @Override - public void setContactMobileNumber (final DialableMobileNumber contactMobileNumber) { - this.contactMobileNumber = contactMobileNumber; - } - - @Override - public void setContactOwnContact (final Boolean contactOwnContact) { - this.contactOwnContact = contactOwnContact; - } - - @Override - public PersonalTitle getContactPersonalTitle () { - return this.contactPersonalTitle; - } - - @Override - public void setContactPersonalTitle (final PersonalTitle contactPersonalTitle) { - this.contactPersonalTitle = contactPersonalTitle; - } - - @Override - public String getContactStreet () { - return this.contactStreet; - } - - @Override - public void setContactStreet (final String contactStreet) { - this.contactStreet = contactStreet; - } - - @Override - public String getContactTitle () { - return this.contactTitle; - } - - @Override - public void setContactTitle (final String contactTitle) { - this.contactTitle = contactTitle; - } - - @Override - @SuppressWarnings ("ReturnOfDateField") - public Calendar getContactUpdated () { - return this.contactUpdated; - } - - @Override - @SuppressWarnings ("AssignmentToDateFieldFromParameter") - public void setContactUpdated (final Calendar contactUpdated) { - this.contactUpdated = contactUpdated; - } - - @Override - public Integer getContactZipCode () { - return this.contactZipCode; - } - - @Override - public void setContactZipCode (final Integer contactZipCode) { - this.contactZipCode = contactZipCode; - } - - @Override - public int hashCode () { - int hash = 5; - - hash = 29 * hash + Objects.hashCode(this.getContactBirthday()); - hash = 29 * hash + Objects.hashCode(this.getContactCity()); - hash = 29 * hash + Objects.hashCode(this.getContactCountry()); - hash = 29 * hash + Objects.hashCode(this.getContactEmailAddress()); - hash = 29 * hash + Objects.hashCode(this.getContactFamilyName()); - hash = 29 * hash + Objects.hashCode(this.getContactFirstName()); - hash = 29 * hash + Objects.hashCode(this.getContactPersonalTitle()); - hash = 29 * hash + Objects.hashCode(this.getContactHouseNumber()); - hash = 29 * hash + Objects.hashCode(this.getContactHouseNumberExtension()); - hash = 29 * hash + Objects.hashCode(this.getContactId()); - hash = 29 * hash + Objects.hashCode(this.getContactStreet()); - hash = 29 * hash + Objects.hashCode(this.getContactTitle()); - - return hash; - } - - @Override - public Boolean isOwnContact () { - return this.contactOwnContact; - } - -} +/* + * Copyright (C) 2016, 2017 Roland Häder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.jcontacts.contact; + +import java.util.Calendar; +import java.util.Date; +import java.util.Objects; +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +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.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.OneToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.Transient; +import org.mxchange.jcontacts.contact.title.PersonalTitle; +import org.mxchange.jcountry.data.Country; +import org.mxchange.jcountry.data.CountryData; +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; +import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber; +import org.mxchange.jphone.phonenumbers.mobile.MobileNumber; + +/** + * A general contact class which serves as an entity. + *

+ * @author Roland Häder + * @version 0.0 + */ +@Entity (name = "contacts") +@Table ( + name = "contacts", + indexes = { + @Index ( + name = "contact_personal_title", + columnList = "contact_personal_title" + ) + } +) +@NamedQueries ( + { + @NamedQuery (name = "AllContacts", query = "SELECT c FROM contacts AS c ORDER BY c.contactId ASC"), + @NamedQuery (name = "AllContactEmailAddresses", query = "SELECT c.contactEmailAddress FROM contacts AS c ORDER BY c.contactId ASC"), + @NamedQuery (name = "AllContactsByCellphone", query = "SELECT c FROM contacts AS c WHERE c.contactMobileNumber = :mobileNumber ORDER BY c.contactId ASC"), + @NamedQuery (name = "SearchContactById", query = "SELECT c FROM contacts AS c WHERE c.contactId = :contactId"), + @NamedQuery (name = "SearchContactByEmailAddress", query = "SELECT c FROM contacts AS c WHERE LOWER(c.contactEmailAddress) LIKE LOWER(:emailAddress)") + } +) +@SuppressWarnings ("PersistenceUnitPresent") +public class UserContact implements Contact { + + /** + * Serial number + */ + @Transient + private static final long serialVersionUID = 58_744_284_981_863L; + + /** + * Birth day + */ + @Column (name = "contact_birthday") + @Temporal (TemporalType.DATE) + private Date contactBirthday; + + /** + * City + */ + @Column (name = "contact_city", length = 100) + private String contactCity; + + /** + * Optional comments + */ + @Lob + @Column (name = "contact_comment") + private String contactComment; + + /** + * Country code + */ + @JoinColumn (name = "contact_country_id", nullable = false, referencedColumnName = "country_id") + @OneToOne (targetEntity = CountryData.class, cascade = CascadeType.REFRESH, optional = false) + private Country contactCountry; + + /** + * When the contact has been created + */ + @Basic (optional = false) + @Temporal (TemporalType.TIMESTAMP) + @Column (name = "contact_created", nullable = false) + private Calendar contactCreated; + + /** + * Email address + */ + @Column (name = "contact_email_address", length = 100, unique = true) + private String contactEmailAddress; + + /** + * Family name + */ + @Basic (optional = false) + @Column (name = "contact_family_name", length = 100, nullable = false) + private String contactFamilyName; + + /** + * Fax number + */ + @JoinColumn (name = "contact_fax_number_id", referencedColumnName = "fax_id", unique = true) + @OneToOne (targetEntity = FaxNumber.class, cascade = CascadeType.ALL) + private DialableFaxNumber contactFaxNumber; + + /** + * First name + */ + @Basic (optional = false) + @Column (name = "contact_first_name", length = 100, nullable = false) + private String contactFirstName; + + /** + * House number + */ + @Column (name = "contact_house_number") + private Short contactHouseNumber; + + /** + * House number extension + */ + @Column (name = "contact_house_number_extension", length = 5) + private String contactHouseNumberExtension; + + /** + * Id number + */ + @Id + @GeneratedValue (strategy = GenerationType.IDENTITY) + @Column (name = "contact_id", nullable = false, updatable = false) + private Long contactId; + + /** + * Cellphone number + */ + @JoinColumn (name = "contact_mobile_number_id", referencedColumnName = "mobile_id", unique = true) + @OneToOne (targetEntity = MobileNumber.class, cascade = CascadeType.ALL) + private DialableMobileNumber contactMobileNumber; + + /** + * Flag whether this contact is user's own data + */ + @Basic (optional = false) + @Column (name = "contact_own_contact", nullable = false) + private Boolean contactOwnContact; + + /** + * Contact's personal title (Mr./Mrs.) + */ + @Basic (optional = false) + @Column (name = "contact_personal_title", nullable = false) + @Enumerated (EnumType.STRING) + private PersonalTitle contactPersonalTitle; + + /** + * Phone number + */ + @JoinColumn (name = "contact_landline_number_id", referencedColumnName = "landline_id", unique = true) + @OneToOne (targetEntity = LandLineNumber.class, cascade = CascadeType.ALL) + private DialableLandLineNumber contactPhoneNumber; + + /** + * Street + */ + @Column (name = "contact_street") + private String contactStreet; + + /** + * Title (Doctor, etc) + */ + @Column (name = "contact_title") + private String contactTitle; + + /** + * When the contact has been updated + */ + @Temporal (TemporalType.TIMESTAMP) + @Column (name = "contact_updated") + private Calendar contactUpdated; + + /** + * ZIP code + */ + @Column (name = "contact_zip_code") + private Integer contactZipCode; + + /** + * Default constructor + */ + public UserContact () { + // Default is not user's own contact + this.contactOwnContact = Boolean.FALSE; + } + + /** + * Constructor for title and names + *

+ * @param contactTitle Personal title + * @param contactFirstName First name + * @param contactFamilyName Family name + */ + public UserContact (final PersonalTitle contactTitle, final String contactFirstName, final String contactFamilyName) { + // Call default constructor + this(); + + // Set all + this.contactPersonalTitle = contactTitle; + this.contactFirstName = contactFirstName; + this.contactFamilyName = contactFamilyName; + } + + @Override + public boolean equals (final Object object) { + if (this == object) { + return true; + } else if (null == object) { + return false; + } else if (this.getClass() != object.getClass()) { + return false; + } else if (!(object instanceof Contact)) { + // Not correct interface + return false; + } + + final Contact other = (Contact) object; + + if (!Objects.equals(this.getContactId(), other.getContactId())) { + return false; + } else if (!Objects.equals(this.getContactCity(), other.getContactCity())) { + return false; + } else if (!Objects.equals(this.getContactEmailAddress(), other.getContactEmailAddress())) { + return false; + } else if (!Objects.equals(this.getContactFamilyName(), other.getContactFamilyName())) { + return false; + } else if (!Objects.equals(this.getContactFirstName(), other.getContactFirstName())) { + return false; + } else if (!Objects.equals(this.getContactStreet(), other.getContactStreet())) { + return false; + } else if (!Objects.equals(this.getContactTitle(), other.getContactTitle())) { + return false; + } else if (!Objects.equals(this.getContactBirthday(), other.getContactBirthday())) { + return false; + } else if (!Objects.equals(this.getContactCountry(), other.getContactCountry())) { + return false; + } else if (this.getContactPersonalTitle() != other.getContactPersonalTitle()) { + return false; + } else if (!Objects.equals(this.getContactHouseNumber(), other.getContactHouseNumber())) { + return false; + } else if (!Objects.equals(this.getContactHouseNumberExtension(), other.getContactHouseNumberExtension())) { + return false; + } + + return true; + } + + @Override + @SuppressWarnings ("ReturnOfDateField") + public Date getContactBirthday () { + return this.contactBirthday; + } + + @Override + @SuppressWarnings ("AssignmentToDateFieldFromParameter") + public void setContactBirthday (final Date contactBirthday) { + this.contactBirthday = contactBirthday; + } + + @Override + public String getContactCity () { + return this.contactCity; + } + + @Override + public void setContactCity (final String contactCity) { + this.contactCity = contactCity; + } + + @Override + public String getContactComment () { + return this.contactComment; + } + + @Override + public void setContactComment (final String contactComment) { + this.contactComment = contactComment; + } + + @Override + public Country getContactCountry () { + return this.contactCountry; + } + + @Override + public void setContactCountry (final Country contactCountry) { + this.contactCountry = contactCountry; + } + + @Override + @SuppressWarnings ("ReturnOfDateField") + public Calendar getContactCreated () { + return this.contactCreated; + } + + @Override + @SuppressWarnings ("AssignmentToDateFieldFromParameter") + public void setContactCreated (final Calendar contactCreated) { + this.contactCreated = contactCreated; + } + + @Override + public String getContactEmailAddress () { + return this.contactEmailAddress; + } + + @Override + public void setContactEmailAddress (final String contactEmailAddress) { + this.contactEmailAddress = contactEmailAddress; + } + + @Override + public String getContactFamilyName () { + //* NOISY-DEBUG: */ this.getLogger().logTrace("CALLED!"); + return this.contactFamilyName; + } + + @Override + public void setContactFamilyName (final String contactFamilyName) { + this.contactFamilyName = contactFamilyName; + } + + @Override + public DialableFaxNumber getContactFaxNumber () { + return this.contactFaxNumber; + } + + @Override + public void setContactFaxNumber (final DialableFaxNumber contactFaxNumber) { + this.contactFaxNumber = contactFaxNumber; + } + + @Override + public String getContactFirstName () { + return this.contactFirstName; + } + + @Override + public void setContactFirstName (final String contactFirstName) { + this.contactFirstName = contactFirstName; + } + + @Override + public Short getContactHouseNumber () { + return this.contactHouseNumber; + } + + @Override + public void setContactHouseNumber (final Short contactHouseNumber) { + this.contactHouseNumber = contactHouseNumber; + } + + @Override + public String getContactHouseNumberExtension () { + return this.contactHouseNumberExtension; + } + + @Override + public void setContactHouseNumberExtension (final String contactHouseNumberExtension) { + this.contactHouseNumberExtension = contactHouseNumberExtension; + } + + @Override + public Long getContactId () { + return this.contactId; + } + + @Override + public void setContactId (final Long contactId) { + this.contactId = contactId; + } + + @Override + public DialableLandLineNumber getContactLandLineNumber () { + return this.contactPhoneNumber; + } + + @Override + public void setContactLandLineNumber (final DialableLandLineNumber contactPhoneNumber) { + this.contactPhoneNumber = contactPhoneNumber; + } + + @Override + public DialableMobileNumber getContactMobileNumber () { + return this.contactMobileNumber; + } + + @Override + public void setContactMobileNumber (final DialableMobileNumber contactMobileNumber) { + this.contactMobileNumber = contactMobileNumber; + } + + @Override + public void setContactOwnContact (final Boolean contactOwnContact) { + this.contactOwnContact = contactOwnContact; + } + + @Override + public PersonalTitle getContactPersonalTitle () { + return this.contactPersonalTitle; + } + + @Override + public void setContactPersonalTitle (final PersonalTitle contactPersonalTitle) { + this.contactPersonalTitle = contactPersonalTitle; + } + + @Override + public String getContactStreet () { + return this.contactStreet; + } + + @Override + public void setContactStreet (final String contactStreet) { + this.contactStreet = contactStreet; + } + + @Override + public String getContactTitle () { + return this.contactTitle; + } + + @Override + public void setContactTitle (final String contactTitle) { + this.contactTitle = contactTitle; + } + + @Override + @SuppressWarnings ("ReturnOfDateField") + public Calendar getContactUpdated () { + return this.contactUpdated; + } + + @Override + @SuppressWarnings ("AssignmentToDateFieldFromParameter") + public void setContactUpdated (final Calendar contactUpdated) { + this.contactUpdated = contactUpdated; + } + + @Override + public Integer getContactZipCode () { + return this.contactZipCode; + } + + @Override + public void setContactZipCode (final Integer contactZipCode) { + this.contactZipCode = contactZipCode; + } + + @Override + public int hashCode () { + int hash = 5; + + hash = 29 * hash + Objects.hashCode(this.getContactBirthday()); + hash = 29 * hash + Objects.hashCode(this.getContactCity()); + hash = 29 * hash + Objects.hashCode(this.getContactCountry()); + hash = 29 * hash + Objects.hashCode(this.getContactEmailAddress()); + hash = 29 * hash + Objects.hashCode(this.getContactFamilyName()); + hash = 29 * hash + Objects.hashCode(this.getContactFirstName()); + hash = 29 * hash + Objects.hashCode(this.getContactPersonalTitle()); + hash = 29 * hash + Objects.hashCode(this.getContactHouseNumber()); + hash = 29 * hash + Objects.hashCode(this.getContactHouseNumberExtension()); + hash = 29 * hash + Objects.hashCode(this.getContactId()); + hash = 29 * hash + Objects.hashCode(this.getContactStreet()); + hash = 29 * hash + Objects.hashCode(this.getContactTitle()); + + return hash; + } + + @Override + public Boolean isOwnContact () { + return this.contactOwnContact; + } + +} diff --git a/src/org/mxchange/jcontacts/events/contact/add/AdminAddedContactEvent.java b/src/org/mxchange/jcontacts/events/contact/add/AdminAddedContactEvent.java index b9eb55d..1e1dd70 100644 --- a/src/org/mxchange/jcontacts/events/contact/add/AdminAddedContactEvent.java +++ b/src/org/mxchange/jcontacts/events/contact/add/AdminAddedContactEvent.java @@ -1,66 +1,66 @@ -/* - * Copyright (C) 2016, 2017 Roland Häder - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package org.mxchange.jcontacts.events.contact.add; - -import java.text.MessageFormat; -import org.mxchange.jcontacts.contact.Contact; - -/** - * An event being fired when the administrator has added a new user account - *

- * @author Roland Häder - */ -public class AdminAddedContactEvent implements ObservableAdminAddedContactEvent { - - /** - * Serial number - */ - private static final long serialVersionUID = 14_785_787_174_676_290L; - - /** - * Added contact instance - */ - private final Contact addedContact; - - /** - * Constructor with added contact instance - *

- * @param addedContact Added contact instance - */ - public AdminAddedContactEvent (final Contact addedContact) { - // Is the contact instance valid? - if (null == addedContact) { - // Throw NPE - throw new NullPointerException("addedContact is null"); //NOI18N - } else if (addedContact.getContactId() == null) { - // Throw NPE again - throw new NullPointerException("addedContact.contactId is null"); //NOI18N - } else if (addedContact.getContactId() < 1) { - // Invalid id number - throw new IllegalArgumentException(MessageFormat.format("addedContact.contactId={0} is invalid.", addedContact.getContactId())); //NOI18N - } - - // Set it here - this.addedContact = addedContact; - } - - @Override - public Contact getAddedContact () { - return this.addedContact; - } - -} +/* + * Copyright (C) 2016, 2017 Roland Häder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.jcontacts.events.contact.add; + +import java.text.MessageFormat; +import org.mxchange.jcontacts.contact.Contact; + +/** + * An event being fired when the administrator has added a new user account + *

+ * @author Roland Häder + */ +public class AdminAddedContactEvent implements ObservableAdminAddedContactEvent { + + /** + * Serial number + */ + private static final long serialVersionUID = 14_785_787_174_676_290L; + + /** + * Added contact instance + */ + private final Contact addedContact; + + /** + * Constructor with added contact instance + *

+ * @param addedContact Added contact instance + */ + public AdminAddedContactEvent (final Contact addedContact) { + // Is the contact instance valid? + if (null == addedContact) { + // Throw NPE + throw new NullPointerException("addedContact is null"); //NOI18N + } else if (addedContact.getContactId() == null) { + // Throw NPE again + throw new NullPointerException("addedContact.contactId is null"); //NOI18N + } else if (addedContact.getContactId() < 1) { + // Invalid id number + throw new IllegalArgumentException(MessageFormat.format("addedContact.contactId={0} is invalid.", addedContact.getContactId())); //NOI18N + } + + // Set it here + this.addedContact = addedContact; + } + + @Override + public Contact getAddedContact () { + return this.addedContact; + } + +} diff --git a/src/org/mxchange/jcontacts/events/contact/update/AdminUpdatedContactEvent.java b/src/org/mxchange/jcontacts/events/contact/update/AdminUpdatedContactEvent.java index d729d58..51e691f 100644 --- a/src/org/mxchange/jcontacts/events/contact/update/AdminUpdatedContactEvent.java +++ b/src/org/mxchange/jcontacts/events/contact/update/AdminUpdatedContactEvent.java @@ -1,66 +1,66 @@ -/* - * Copyright (C) 2016, 2017 Roland Häder - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package org.mxchange.jcontacts.events.contact.update; - -import java.text.MessageFormat; -import org.mxchange.jcontacts.contact.Contact; - -/** - * An event being fired when the administrator has updated a new user account - *

- * @author Roland Häder - */ -public class AdminUpdatedContactEvent implements ObservableAdminUpdatedContactEvent { - - /** - * Serial number - */ - private static final long serialVersionUID = 185_381_945_234_802L; - - /** - * Updated contact instance - */ - private final Contact updatedContact; - - /** - * Constructor with updated contact instance - *

- * @param updatedContact Updated contact instance - */ - public AdminUpdatedContactEvent (final Contact updatedContact) { - // Is the contact instance valid? - if (null == updatedContact) { - // Throw NPE - throw new NullPointerException("updatedContact is null"); //NOI18N - } else if (updatedContact.getContactId() == null) { - // Throw NPE again - throw new NullPointerException("updatedContact.contactId is null"); //NOI18N - } else if (updatedContact.getContactId() < 1) { - // Invalid id number - throw new IllegalArgumentException(MessageFormat.format("updatedContact.contactId={0} is invalid.", updatedContact.getContactId())); //NOI18N - } - - // Set it here - this.updatedContact = updatedContact; - } - - @Override - public Contact getUpdatedContact () { - return this.updatedContact; - } - -} +/* + * Copyright (C) 2016, 2017 Roland Häder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.jcontacts.events.contact.update; + +import java.text.MessageFormat; +import org.mxchange.jcontacts.contact.Contact; + +/** + * An event being fired when the administrator has updated a new user account + *

+ * @author Roland Häder + */ +public class AdminUpdatedContactEvent implements ObservableAdminUpdatedContactEvent { + + /** + * Serial number + */ + private static final long serialVersionUID = 185_381_945_234_802L; + + /** + * Updated contact instance + */ + private final Contact updatedContact; + + /** + * Constructor with updated contact instance + *

+ * @param updatedContact Updated contact instance + */ + public AdminUpdatedContactEvent (final Contact updatedContact) { + // Is the contact instance valid? + if (null == updatedContact) { + // Throw NPE + throw new NullPointerException("updatedContact is null"); //NOI18N + } else if (updatedContact.getContactId() == null) { + // Throw NPE again + throw new NullPointerException("updatedContact.contactId is null"); //NOI18N + } else if (updatedContact.getContactId() < 1) { + // Invalid id number + throw new IllegalArgumentException(MessageFormat.format("updatedContact.contactId={0} is invalid.", updatedContact.getContactId())); //NOI18N + } + + // Set it here + this.updatedContact = updatedContact; + } + + @Override + public Contact getUpdatedContact () { + return this.updatedContact; + } + +} diff --git a/src/org/mxchange/jcontacts/events/contact/update/ObservableAdminUpdatedContactEvent.java b/src/org/mxchange/jcontacts/events/contact/update/ObservableAdminUpdatedContactEvent.java index ebe9e19..845fae8 100644 --- a/src/org/mxchange/jcontacts/events/contact/update/ObservableAdminUpdatedContactEvent.java +++ b/src/org/mxchange/jcontacts/events/contact/update/ObservableAdminUpdatedContactEvent.java @@ -1,37 +1,37 @@ -/* - * Copyright (C) 2016, 2017 Roland Häder - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package org.mxchange.jcontacts.events.contact.update; - -import java.io.Serializable; -import org.mxchange.jcontacts.contact.Contact; - -/** - * An interface for events being fired when an administrator updated a new user - * account. - *

- * @author Roland Häder - */ -public interface ObservableAdminUpdatedContactEvent extends Serializable { - - /** - * Getter for updated contact instance - *

- * @return Updated contact instance - */ - Contact getUpdatedContact (); - -} +/* + * Copyright (C) 2016, 2017 Roland Häder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.jcontacts.events.contact.update; + +import java.io.Serializable; +import org.mxchange.jcontacts.contact.Contact; + +/** + * An interface for events being fired when an administrator updated a new user + * account. + *

+ * @author Roland Häder + */ +public interface ObservableAdminUpdatedContactEvent extends Serializable { + + /** + * Getter for updated contact instance + *

+ * @return Updated contact instance + */ + Contact getUpdatedContact (); + +} -- 2.39.5