2 * Copyright (C) 2016 - 2022 Free Software Foundation
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Affero General Public License as
6 * published by the Free Software Foundation, either version 3 of the
7 * License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Affero General Public License for more details.
14 * You should have received a copy of the GNU Affero General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 package org.mxchange.jfinancials.beans.contact.phone;
19 import java.text.MessageFormat;
20 import java.util.Date;
22 import javax.enterprise.context.RequestScoped;
23 import javax.enterprise.event.Event;
24 import javax.enterprise.event.Observes;
25 import javax.enterprise.inject.Any;
26 import javax.faces.application.FacesMessage;
27 import javax.inject.Inject;
28 import javax.inject.Named;
29 import org.mxchange.jcontacts.events.contact.add.ObservableAdminAddedContactEvent;
30 import org.mxchange.jcontacts.events.contact.created.ObservableCreatedContactEvent;
31 import org.mxchange.jcontacts.events.contact.update.ObservableAdminUpdatedContactEvent;
32 import org.mxchange.jcontacts.events.contact.update.ObservableUpdatedContactEvent;
33 import org.mxchange.jcontacts.events.fax.linked.AdminLinkedFaxNumberEvent;
34 import org.mxchange.jcontacts.events.fax.linked.ObservableAdminLinkedFaxNumberEvent;
35 import org.mxchange.jcontacts.events.fax.unlinked.AdminUnlinkedFaxNumberEvent;
36 import org.mxchange.jcontacts.events.fax.unlinked.ObservableAdminUnlinkedFaxNumberEvent;
37 import org.mxchange.jcontacts.events.landline.linked.AdminLinkedLandLineNumberEvent;
38 import org.mxchange.jcontacts.events.landline.linked.ObservableAdminLinkedLandLineNumberEvent;
39 import org.mxchange.jcontacts.events.landline.unlinked.AdminUnlinkedLandLineNumberEvent;
40 import org.mxchange.jcontacts.events.landline.unlinked.ObservableAdminUnlinkedLandLineNumberEvent;
41 import org.mxchange.jcontacts.exceptions.ContactNotFoundException;
42 import org.mxchange.jcontacts.model.contact.Contact;
43 import org.mxchange.jcontacts.model.phone.AdminContactsPhoneSessionBeanRemote;
44 import org.mxchange.jcountry.model.data.Country;
45 import org.mxchange.jfinancials.beans.BaseFinancialsBean;
46 import org.mxchange.jphone.events.fax.created.ObservableCreatedFaxNumberEvent;
47 import org.mxchange.jphone.events.landline.created.ObservableCreatedLandLineNumberEvent;
48 import org.mxchange.jphone.exceptions.phone.PhoneNumberAlreadyLinkedException;
49 import org.mxchange.jphone.exceptions.phone.PhoneNumberNotLinkedException;
50 import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
51 import org.mxchange.jphone.model.phonenumbers.fax.FaxNumber;
52 import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
53 import org.mxchange.jphone.model.phonenumbers.landline.LandLineNumber;
54 import org.mxchange.jusercore.events.user.add.ObservableAdminAddedUserEvent;
57 * An administrative contact phone controller (bean)
59 * @author Roland Häder<roland@mxchange.org>
61 @Named ("adminContactPhoneController")
63 public class FinancialsAdminContactPhoneWebRequestBean extends BaseFinancialsBean implements FinancialsAdminContactPhoneWebRequestController {
66 * Call-stack instance (5 may show BeanELResolver.getValue as caller)
68 private static final short THREAD_STACK = 5;
73 private static final long serialVersionUID = 542_145_354_001L;
76 * Administrative EJB for phone number
78 @EJB (lookup = "java:global/jfinancials-ejb/adminContactPhone!org.mxchange.jcontacts.model.phone.AdminContactsPhoneSessionBeanRemote")
79 private AdminContactsPhoneSessionBeanRemote adminContactPhoneBean;
82 * Event being fired when a fax number has been linked
86 private Event<ObservableAdminLinkedFaxNumberEvent> adminLinkedFaxNumberEvent;
89 * Event being fired when a land-line number has been linked
93 private Event<ObservableAdminLinkedLandLineNumberEvent> adminLinkedLandLineNumberEvent;
98 private Contact contact;
101 * Area code (city dial prefix) for fax number
103 private Integer faxAreaCode;
106 * Country (for dial prefix) for fax number
108 private Country faxCountry;
113 private Long faxNumber;
116 * Event being fired when a fax number has been unlinked
120 private Event<ObservableAdminUnlinkedFaxNumberEvent> faxNumberUnlinkedEvent;
123 * Area code (city dial prefix) for land-line number
125 private Integer landLineAreaCode;
128 * Country (for dial prefix) for land-line number
130 private Country landLineCountry;
135 private Long landLineNumber;
138 * Event being fired when a land-line number has been unlinked
142 private Event<ObservableAdminUnlinkedLandLineNumberEvent> landLineNumberUnlinkedEvent;
145 * When phone number has been created
147 private Date phoneEntryCreated;
150 * When phone number has been updated
152 private Date phoneEntryUpdated;
155 * Phone id (primary key)
157 private Long phoneId;
160 * Default constructor
162 public FinancialsAdminContactPhoneWebRequestBean () {
163 // Call super constructor
166 // String caller = MessageFormat.format("{0}.{1}", Thread.currentThread().getStackTrace()[3].getClassName(), Thread.currentThread().getStackTrace()[3].getMethodName());
167 // System.out.println(MessageFormat.format("{0}: Constructed, caller: {1}", this.getClass().getSimpleName(), caller));
171 * Observes events being fired when an administrator has added a new
174 * @param event Event being fired
176 public void afterAdminAddedContactEvent (@Observes final ObservableAdminAddedContactEvent event) {
177 // The event must be valid
180 throw new NullPointerException("event is null"); //NOI18N
181 } else if (event.getAddedContact() == null) {
183 throw new NullPointerException("event.addedContact is null"); //NOI18N
184 } else if (event.getAddedContact().getContactId() == null) {
186 throw new NullPointerException("event.addedContact.contactId is null"); //NOI18N
187 } else if (event.getAddedContact().getContactId() < 1) {
189 throw new IllegalArgumentException(MessageFormat.format("event.addedContact.contactId={0} is not valid", event.getAddedContact().getContactId())); //NOI18N
197 * Event observer for newly added users by administrator
199 * @param event Event being fired
201 public void afterAdminAddedUserEvent (@Observes final ObservableAdminAddedUserEvent event) {
202 // Event and contained entity instance should not be null
205 throw new NullPointerException("event is null"); //NOI18N
206 } else if (event.getAddedUser() == null) {
208 throw new NullPointerException("event.addedUser is null"); //NOI18N
209 } else if (event.getAddedUser().getUserId() == null) {
211 throw new NullPointerException("event.addedUser.userId is null"); //NOI18N
212 } else if (event.getAddedUser().getUserId() < 1) {
214 throw new IllegalArgumentException(MessageFormat.format("userId of user={0} is not valid: {1}", event.getAddedUser(), event.getAddedUser().getUserId())); //NOI18N
222 * Event observer for updated contact data by administrators
224 * @param event Updated contact data event
226 public void afterAdminUpdatedContactDataEvent (@Observes final ObservableAdminUpdatedContactEvent event) {
227 // Event and contained entity instance should not be null
230 throw new NullPointerException("event is null"); //NOI18N
231 } else if (event.getUpdatedContact() == null) {
233 throw new NullPointerException("event.updatedContact is null"); //NOI18N
234 } else if (event.getUpdatedContact().getContactId() == null) {
236 throw new NullPointerException("event.updatedContact.contactId is null"); //NOI18N
237 } else if (event.getUpdatedContact().getContactId() < 1) {
239 throw new IllegalArgumentException(MessageFormat.format("contactId of contact={0} is not valid: {1}", event.getUpdatedContact(), event.getUpdatedContact().getContactId())); //NOI18N
247 * Observer for events being fired when a bean helper has successfully
248 * created a contact instance.
250 * @param event Event being fired
252 public void afterCreatedContactEvent (@Observes final ObservableCreatedContactEvent event) {
254 //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("AdminContactController::afterCreatedContactEvent(): contact={0} - CALLED!", contact)); //NOI18N
256 // The event instance must be valid
259 throw new NullPointerException("event is null"); //NOI18N
260 } else if (event.getCreatedContact() == null) {
262 throw new NullPointerException("event.createdContact is null"); //NOI18N
263 } else if (event.getCreatedContact().getContactId() == null) {
265 throw new NullPointerException("event.createdContact.contactId is null"); //NOI18N
266 } else if (event.getCreatedContact().getContactId() < 1) {
268 throw new IllegalStateException(MessageFormat.format("event.createdContact.contactId={0} is not valid.", event.getCreatedContact().getContactId())); //NOI18N
272 this.setContact(event.getCreatedContact());
276 * Observes events being fired when a bean helper has successfully created a
277 * fax number instance.
279 * @param event Event being fired
281 public void afterCreatedFaxNumberEvent (@Observes final ObservableCreatedFaxNumberEvent event) {
282 // The event instance must be valid
285 throw new NullPointerException("event is null"); //NOI18N
286 } else if (event.getFaxNumber() == null) {
288 throw new NullPointerException("event.faxNumber is null"); //NOI18N
289 } else if (event.getFaxNumber().getPhoneId() == null) {
290 // Throw NPE yet again
291 throw new NullPointerException("event.faxNumber.phoneId is null"); //NOI18N
292 } else if (event.getFaxNumber().getPhoneId() < 1) {
293 // Throw NPE yet again
294 throw new NullPointerException(MessageFormat.format("event.faxNumber.phoneId={0} is invalid", event.getFaxNumber().getPhoneId())); //NOI18N
297 // Get fax number from event
298 final DialableFaxNumber number = event.getFaxNumber();
300 // Copy all data to this bean
301 this.setPhoneId(number.getPhoneId());
302 this.setFaxCountry(number.getPhoneCountry());
303 this.setFaxAreaCode(number.getPhoneAreaCode());
304 this.setFaxNumber(number.getPhoneNumber());
305 this.setPhoneEntryCreated(number.getPhoneEntryCreated());
306 this.setPhoneEntryUpdated(number.getPhoneEntryUpdated());
310 * Observes events being fired when a bean helper has successfully created a
311 * land-line number instance.
313 * @param event Event being fired
315 public void afterCreatedLandLineNumberEvent (@Observes final ObservableCreatedLandLineNumberEvent event) {
316 // The event instance must be valid
319 throw new NullPointerException("event is null"); //NOI18N
320 } else if (event.getLandLineNumber() == null) {
322 throw new NullPointerException("event.landLineNumber is null"); //NOI18N
323 } else if (event.getLandLineNumber().getPhoneId() == null) {
324 // Throw NPE yet again
325 throw new NullPointerException("event.landLineNumber.phoneId is null"); //NOI18N
326 } else if (event.getLandLineNumber().getPhoneId() < 1) {
327 // Throw NPE yet again
328 throw new NullPointerException(MessageFormat.format("event.landLineNumber.phoneId={0} is invalid", event.getLandLineNumber().getPhoneId())); //NOI18N
331 // Get fax number from event
332 final DialableLandLineNumber number = event.getLandLineNumber();
334 // Copy all data to this bean
335 this.setPhoneId(number.getPhoneId());
336 this.setLandLineCountry(number.getPhoneCountry());
337 this.setLandLineAreaCode(number.getPhoneAreaCode());
338 this.setLandLineNumber(number.getPhoneNumber());
339 this.setPhoneEntryCreated(number.getPhoneEntryCreated());
340 this.setPhoneEntryUpdated(number.getPhoneEntryUpdated());
344 * Event observer for updated contact data by the user
346 * @param event Updated contact data event
348 public void afterUpdatedContactDataEvent (@Observes final ObservableUpdatedContactEvent event) {
349 // Event and contained entity instance should not be null
352 throw new NullPointerException("event is null"); //NOI18N
353 } else if (event.getUpdatedContact() == null) {
355 throw new NullPointerException("event.updatedContact is null"); //NOI18N
356 } else if (event.getUpdatedContact().getContactId() == null) {
358 throw new NullPointerException("event.updatedContact.contactId is null"); //NOI18N
359 } else if (event.getUpdatedContact().getContactId() < 1) {
361 throw new IllegalArgumentException(MessageFormat.format("contactId of contact={0} is not valid: {1}", event.getUpdatedContact(), event.getUpdatedContact().getContactId())); //NOI18N
369 * Links fax number to contact from bean helper as "main fax number".
371 * @return Redirect outcome
373 public String doLinkMainFaxNumber () {
374 // Get contact from helper
375 final Contact targetContact = this.getContact();
377 // Is all data properly set?
378 if (null == targetContact) {
380 throw new NullPointerException("targetContact is null"); //NOI18N
381 } else if (targetContact.getContactId() == null) {
383 throw new NullPointerException("targetContact.contactId is null"); //NOI18N
384 } else if (targetContact.getContactId() < 1) {
386 throw new IllegalArgumentException(MessageFormat.format("targetContact.contactId={0} is not valid", targetContact.getContactId())); //NOI18N
387 } else if (this.getFaxCountry() == null) {
389 throw new NullPointerException("this.faxCountry is null"); //NOI18N
390 } else if (this.getFaxCountry().getCountryId() == null) {
392 throw new NullPointerException("this.faxCountry.countryId is null"); //NOI18N
393 } else if (this.getFaxCountry().getCountryId() < 1) {
395 throw new IllegalArgumentException(MessageFormat.format("this.faxCountry.countryId={0} is not valid.", this.getFaxCountry().getCountryId())); //NOI18N
396 } else if (this.getFaxAreaCode() == null) {
398 throw new NullPointerException("this.faxAreaCode is null"); //NOI18N
399 } else if (this.getFaxAreaCode() < 1) {
401 throw new IllegalArgumentException(MessageFormat.format("this.faxAreaCode={0} is invalid", this.getFaxAreaCode())); //NOI18N
402 } else if (this.getFaxNumber() == null) {
404 throw new NullPointerException("this.faxNumber is null"); //NOI18N
405 } else if (this.getFaxNumber() < 1) {
407 throw new IllegalArgumentException(MessageFormat.format("this.faxNumber={0} is invalid", this.getFaxNumber())); //NOI18N
411 final Contact updatedContact;
412 final DialableFaxNumber number = new FaxNumber(this.getFaxCountry(), this.getFaxAreaCode(), this.getFaxNumber());
417 updatedContact = this.adminContactPhoneBean.linkNewFaxNumberWithContact(targetContact, number);
418 } catch (final PhoneNumberAlreadyLinkedException | ContactNotFoundException ex) {
419 // Throw again as cause
420 this.showFacesException("form_add_contact_fax:faxNumber", ex, FacesMessage.SEVERITY_ERROR); //NOI18N
425 this.adminLinkedFaxNumberEvent.fire(new AdminLinkedFaxNumberEvent(updatedContact, number));
427 // Return to contact profile
428 return "admin_show_contact"; //NOI18N
432 * Links land-line number to contact from bean helper as "main land-line
435 * @return Redirect outcome
437 public String doLinkMainLandLineNumber () {
438 // Get contact from helper
439 final Contact targetContact = this.getContact();
441 // Is all data properly set?
442 if (null == targetContact) {
444 throw new NullPointerException("targetContact is null"); //NOI18N
445 } else if (targetContact.getContactId() == null) {
447 throw new NullPointerException("targetContact.contactId is null"); //NOI18N
448 } else if (targetContact.getContactId() < 1) {
450 throw new IllegalArgumentException(MessageFormat.format("targetContact.contactId={0} is not valid", targetContact.getContactId())); //NOI18N
451 } else if (this.getLandLineCountry() == null) {
453 throw new NullPointerException("this.landLineCountry is null"); //NOI18N
454 } else if (this.getLandLineCountry().getCountryId() == null) {
456 throw new NullPointerException("this.landLineCountry.countryId is null"); //NOI18N
457 } else if (this.getLandLineCountry().getCountryId() < 1) {
459 throw new IllegalArgumentException(MessageFormat.format("this.landLineCountry.countryId={0} is not valid.", this.getLandLineCountry().getCountryId())); //NOI18N
460 } else if (this.getLandLineAreaCode() == null) {
462 throw new NullPointerException("this.landLineAreaCode is null"); //NOI18N
463 } else if (this.getLandLineAreaCode() < 1) {
465 throw new IllegalArgumentException(MessageFormat.format("this.landLineAreaCode={0} is invalid", this.getLandLineAreaCode())); //NOI18N
466 } else if (this.getLandLineNumber() == null) {
468 throw new NullPointerException("this.landLineNumber is null"); //NOI18N
469 } else if (this.getLandLineNumber() < 1) {
471 throw new IllegalArgumentException(MessageFormat.format("this.landLineNumber={0} is invalid", this.getLandLineNumber())); //NOI18N
475 final Contact updatedContact;
476 final DialableLandLineNumber number = new LandLineNumber(this.getLandLineCountry(), this.getLandLineAreaCode(), this.getLandLineNumber());
481 updatedContact = this.adminContactPhoneBean.linkNewLandLineNumberWithContact(targetContact, number);
482 } catch (final PhoneNumberAlreadyLinkedException | ContactNotFoundException ex) {
483 // Throw again as cause
484 this.showFacesException("form_add_contact_landLine:landLineNumber", ex, FacesMessage.SEVERITY_ERROR); //NOI18N
489 this.adminLinkedLandLineNumberEvent.fire(new AdminLinkedLandLineNumberEvent(updatedContact, number));
491 // Return to contact profile
492 return "admin_show_contact"; //NOI18N
496 * Getter for contact instance
498 * @return Contact instance
500 public Contact getContact () {
505 * Setter for contact instance
507 * @param contact Contact instance
509 public void setContact (final Contact contact) {
510 this.contact = contact;
514 * Getter for fax area code
516 * @return Fax area code
518 public Integer getFaxAreaCode () {
519 return this.faxAreaCode;
523 * Setter for fax area code
525 * @param faxAreaCode Fax area code
527 public void setFaxAreaCode (final Integer faxAreaCode) {
528 this.faxAreaCode = faxAreaCode;
532 * Getter for fax numbers country
534 * @return Fax numbers country
536 public Country getFaxCountry () {
537 return this.faxCountry;
541 * Setter for fax numbers country
543 * @param faxCountry Fax numbers country
545 public void setFaxCountry (final Country faxCountry) {
546 this.faxCountry = faxCountry;
550 * Getter for fax number
554 public Long getFaxNumber () {
555 return this.faxNumber;
559 * Setter for fax number
561 * @param faxNumber Fax number
563 public void setFaxNumber (final Long faxNumber) {
564 this.faxNumber = faxNumber;
568 * Getter for land-line area code
570 * @return Land-line area code
572 public Integer getLandLineAreaCode () {
573 return this.landLineAreaCode;
577 * Setter for land-line area code
579 * @param landLineAreaCode Land-line area code
581 public void setLandLineAreaCode (final Integer landLineAreaCode) {
582 this.landLineAreaCode = landLineAreaCode;
586 * Getter for land-line country
588 * @return Land-line country
590 public Country getLandLineCountry () {
591 return this.landLineCountry;
595 * Setter for land-line country
597 * @param landLineCountry Land-line country
599 public void setLandLineCountry (final Country landLineCountry) {
600 this.landLineCountry = landLineCountry;
604 * Getter for land-line number
606 * @return Land-line number
608 public Long getLandLineNumber () {
609 return this.landLineNumber;
613 * Setter for land-line number
615 * @param landLineNumber Land-line number
617 public void setLandLineNumber (final Long landLineNumber) {
618 this.landLineNumber = landLineNumber;
622 * Setter for phone id
626 public Long getPhoneId () {
631 * Getter for phone id
633 * @param phoneId Phone id
635 public void setPhoneId (final Long phoneId) {
636 this.phoneId = phoneId;
640 * Unlinks fax data with current contact
642 * @return Redirect outcome
644 public String unlinkFaxContactData () {
645 // Create fax number instance
646 final DialableFaxNumber number = this.createFaxNumber();
649 if (number == null) {
650 // Not set, throw NPE
651 throw new NullPointerException("number is null"); //NOI18N
652 } else if (number.getPhoneId() == null) {
654 throw new NullPointerException("number.phoneId is null"); //NOI18N
655 } else if (number.getPhoneId() < 1) {
657 throw new IllegalArgumentException(MessageFormat.format("number.phoneId={0} is not valid", number.getPhoneId())); //NOI18N
658 } else if (number.getPhoneNumber() == null) {
660 throw new NullPointerException("number.phoneNumber is null"); //NOI18N
661 } else if (number.getPhoneNumber() < 1) {
662 // Throw it again ...
663 throw new NullPointerException(MessageFormat.format("number.phoneNumber={0} is not valid.", number.getPhoneNumber())); //NOI18N
664 } else if (this.getContact() == null) {
665 // ... and throw again
666 throw new NullPointerException("this.contact is null"); //NOI18N
667 } else if (this.getContact().getContactId() == null) {
669 throw new NullPointerException("this.contact.contactId is null"); //NOI18N
670 } else if (this.getContact().getContactId() < 1) {
672 throw new IllegalArgumentException(MessageFormat.format("this.contact.contactId={0} is invalid.", this.getContact().getContactId())); //NOI18N
675 // Init contact instance
676 final Contact updatedContact;
679 // Unlink it and return contact without fax instance
680 updatedContact = this.adminContactPhoneBean.unlinkFaxDataFromContact(this.getContact(), number);
681 } catch (final PhoneNumberNotLinkedException | ContactNotFoundException ex) {
683 this.showFacesException("form_unlink_contact_fax:faxNumberId", ex, FacesMessage.SEVERITY_ERROR); //NOI18N
688 this.faxNumberUnlinkedEvent.fire(new AdminUnlinkedFaxNumberEvent(updatedContact, number));
691 return "admin_show_contact"; //NOI18N
695 * Unlinks land-line data with current contact
697 * @return Redirect outcome
699 public String unlinkLandLineContactData () {
700 // Create fax number instance
701 final DialableLandLineNumber number = this.createLandLineNumber();
704 if (number == null) {
705 // Not set, throw NPE
706 throw new NullPointerException("number is null"); //NOI18N
707 } else if (number.getPhoneId() == null) {
709 throw new NullPointerException("number.phoneId is null"); //NOI18N
710 } else if (number.getPhoneId() < 1) {
712 throw new IllegalArgumentException(MessageFormat.format("number.phoneId={0} is not valid", number.getPhoneId())); //NOI18N
713 } else if (number.getPhoneNumber() == null) {
715 throw new NullPointerException("number.phoneNumber is null"); //NOI18N
716 } else if (number.getPhoneNumber() < 1) {
717 // Throw it again ...
718 throw new NullPointerException(MessageFormat.format("number.phoneNumber={0} is not valid.", number.getPhoneNumber())); //NOI18N
719 } else if (this.getContact() == null) {
720 // ... and throw again
721 throw new NullPointerException("this.contact is null"); //NOI18N
722 } else if (this.getContact().getContactId() == null) {
724 throw new NullPointerException("this.contact.contactId is null"); //NOI18N
725 } else if (this.getContact().getContactId() < 1) {
727 throw new IllegalArgumentException(MessageFormat.format("this.contact.contactId={0} is invalid.", this.getContact().getContactId())); //NOI18N
730 // Init contact instance
731 final Contact updatedContact;
734 // Unlink it and return contact without landLine instance
735 updatedContact = this.adminContactPhoneBean.unlinkLandLineDataFromContact(this.getContact(), number);
736 } catch (final PhoneNumberNotLinkedException | ContactNotFoundException ex) {
738 this.showFacesException("form_unlink_contact_landLine:landLineNumberId", ex, FacesMessage.SEVERITY_ERROR); //NOI18N
743 this.landLineNumberUnlinkedEvent.fire(new AdminUnlinkedLandLineNumberEvent(updatedContact, number));
746 return "admin_show_contact"; //NOI18N
752 private void clear () {
757 * Creates an instance of a DialableFaxNumber class
759 * @return DialableFaxNumber class
761 private DialableFaxNumber createFaxNumber () {
763 final DialableFaxNumber number = new FaxNumber(this.getFaxCountry(), this.getFaxAreaCode(), this.getFaxNumber());
765 // Set all other fields
766 number.setPhoneEntryCreated(this.getPhoneEntryCreated());
767 number.setPhoneEntryUpdated(this.getPhoneEntryUpdated());
768 number.setPhoneId(this.getPhoneId());
775 * Returns an instance of a DialableLandLineNumber from all fields stored in
778 * @return An instance of a DialableLandLineNumber class
780 private DialableLandLineNumber createLandLineNumber () {
782 final DialableLandLineNumber number = new LandLineNumber(this.getLandLineCountry(), this.getLandLineAreaCode(), this.getLandLineNumber());
784 // Add all other data
785 number.setPhoneEntryCreated(this.getPhoneEntryCreated());
786 number.setPhoneEntryUpdated(this.getPhoneEntryUpdated());
787 number.setPhoneId(this.getPhoneId());
794 * Getter for phone entry created
796 * @return Phone entry created
798 @SuppressWarnings ("ReturnOfDateField")
799 private Date getPhoneEntryCreated () {
800 return this.phoneEntryCreated;
804 * Setter for phone entry created
806 * @param phoneEntryCreated Phone entry created
808 @SuppressWarnings ("AssignmentToDateFieldFromParameter")
809 private void setPhoneEntryCreated (final Date phoneEntryCreated) {
810 this.phoneEntryCreated = phoneEntryCreated;
814 * Getter for phone entry updated
816 * @return Phone entry updated
818 @SuppressWarnings ("ReturnOfDateField")
819 private Date getPhoneEntryUpdated () {
820 return this.phoneEntryUpdated;
824 * Setter for phone entry updated
826 * @param phoneEntryUpdated Phone entry updated
828 @SuppressWarnings ("AssignmentToDateFieldFromParameter")
829 private void setPhoneEntryUpdated (final Date phoneEntryUpdated) {
830 this.phoneEntryUpdated = phoneEntryUpdated;