import org.mxchange.jcontacts.model.contact.AdminContactSessionBeanRemote;
import org.mxchange.jcontacts.model.contact.Contact;
import org.mxchange.jcontacts.model.contact.ContactSessionBeanRemote;
-import org.mxchange.jcontacts.model.utils.ContactUtils;
import org.mxchange.jcontacts.model.contact.UserContact;
import org.mxchange.jcontacts.model.contact.title.PersonalTitle;
+import org.mxchange.jcontacts.model.utils.ContactUtils;
import org.mxchange.jcountry.model.data.Country;
import org.mxchange.jfinancials.beans.BaseFinancialsBean;
import org.mxchange.jfinancials.beans.contact.list.FinancialsContactListWebViewController;
private boolean isLandLineUnlinked;
/**
- * Whether a cmobile entry has been unlinked
+ * Whether a mobile entry has been unlinked
*/
private boolean isMobileNumberUnlinked;
} else if (this.getFamilyName().isEmpty()) {
// Empty string
throw new IllegalStateException("familyName is empty"); //NOI18N
+ } else if (this.getContactCountry() == null) {
+ // Throw NPE
+ throw new NullPointerException("contactCountry is null"); //NOI18N
+ } else if (this.getContactCountry().getCountryId() == null) {
+ // Throw it again
+ throw new NullPointerException("contactCountry.countryId is null"); //NOI18N
+ } else if (this.getContactCountry().getCountryId() < 1) {
+ // Throw IAE
+ throw new IllegalArgumentException(MessageFormat.format("contactCountry.countryId={0} is invalid", this.getContactCountry().getCountryId())); //NOI18N
}
// Generate phone number
final Contact localContact = new UserContact(
this.getPersonalTitle(),
this.getFirstName(),
- this.getFamilyName()
+ this.getFamilyName(),
+ this.getContactCountry()
);
// Add all others
localContact.setContactBirthday(this.getBirthday());
localContact.setContactCity(this.getCity());
localContact.setContactComment(this.getComment());
- localContact.setContactCountry(this.getContactCountry());
localContact.setContactEmailAddress(this.getEmailAddress());
localContact.setContactHouseNumber(this.getHouseNumber());
localContact.setContactId(this.getContactId());
localContact.setContactTitle(this.getAcademicTitle());
localContact.setContactZipCode(this.getZipCode());
- // Set ownContact
- localContact.setContactOwnContact(Boolean.TRUE);
-
// Don't set null or wrong references
if ((landLine instanceof DialableLandLineNumber) && (landLine.getPhoneCountry() instanceof Country) && (this.getLandLineAreaCode() != null) && (this.getLandLineNumber() != null) && (this.getLandLineAreaCode() > 0) && (this.getLandLineNumber() > 0)) {
// Now the number must be given
import org.mxchange.jcontacts.exceptions.ContactNotFoundException;
import org.mxchange.jcontacts.model.contact.Contact;
import org.mxchange.jcontacts.model.contact.ContactSessionBeanRemote;
-import org.mxchange.jcontacts.model.utils.ContactUtils;
import org.mxchange.jcontacts.model.contact.UserContact;
import org.mxchange.jcontacts.model.contact.title.PersonalTitle;
+import org.mxchange.jcontacts.model.utils.ContactUtils;
import org.mxchange.jcountry.model.data.Country;
import org.mxchange.jfinancials.beans.BaseFinancialsBean;
import org.mxchange.jfinancials.beans.contact.list.FinancialsContactListWebViewController;
final Contact contact = new UserContact(
this.getPersonalTitle(),
this.getFirstName(),
- this.getFamilyName()
+ this.getFamilyName(),
+ this.getCountry()
);
// Return instance