*/
package org.mxchange.jjobs.beans.contact;
+import de.chotime.landingpage.beans.login.LandingUserLoginWebSessionController;
import java.text.MessageFormat;
+import java.util.Collections;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import org.mxchange.jcontacts.contact.UserContact;
import org.mxchange.jcontacts.contact.gender.Gender;
import org.mxchange.jcontacts.contact.utils.ContactUtils;
+import org.mxchange.jcontacts.events.contact.add.AdminAddedContactEvent;
import org.mxchange.jcontacts.events.contact.update.AdminUpdatedContactEvent;
import org.mxchange.jcontacts.exceptions.ContactNotFoundException;
import org.mxchange.jcountry.data.Country;
}
@Override
- @SuppressWarnings ("ReturnOfCollectionOrArrayField")
public List<Contact> allContacts () {
// Debug message
- /* NOISY-DEBUG: */ System.out.println(MessageFormat.format("ContactController.allContacts: contactList.size()={0} - EXIT!", this.contactList.size()));
+ //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("ContactController.allContacts: contactList.size()={0} - EXIT!", this.contactList.size()));
// Return un-modified list
- return this.contactList;
+ return Collections.unmodifiableList(this.contactList);
}
@Override
// Debug message
//* NOISY-DEBUG: */ System.out.println(MessageFormat.format("{0}.createContactInstance: this.emailAddress={1}", this.getClass().getSimpleName(), this.getEmailAddress()));
+
// Don't set null or wrong references
if ((phone instanceof DialableLandLineNumber) && (phone.getPhoneCountry() instanceof Country) && (this.getPhoneAreaCode() != null) && (this.getPhoneNumber() != null) && (this.getPhoneAreaCode() > 0) && (this.getPhoneNumber() > 0)) {
// Now the number must be given
@Override
public boolean hasContacts () {
- return (!this.allContacts().isEmpty());
+ return (!this.contactList.isEmpty());
}
/**
@Override
public boolean isEmailAddressRegistered (final Contact contact) {
+ // Cherck parameter
+ if (null == contact) {
+ // Throw NPE
+ throw new NullPointerException("contact is null"); //NOI18N
+ } else if (contact.getContactEmailAddress() == null) {
+ // Throw again
+ throw new NullPointerException("contact.contactEmailAddress is null"); //NOI18N
+ } else if (contact.getContactEmailAddress().isEmpty()) {
+ // Is empty
+ throw new IllegalArgumentException("contact.contactEmailAddress is empty."); //NOI18N
+ }
+
+ // Determine it
return ((this.emailAddressList instanceof List) && (this.emailAddressList.contains(contact.getContactEmailAddress())));
}