if (this.userNameList.contains(user.getUserName())) {
// Abort here
throw new IllegalArgumentException(MessageFormat.format("User name {0} already added.", user.getUserName()));
- } else if (this.emailAddressList.contains(user.getUserContact().getEmailAddress())) {
+ } else if (this.emailAddressList.contains(user.getUserContact().getContactEmailAddress())) {
// Already added
- throw new IllegalArgumentException(MessageFormat.format("Email address {0} already added.", user.getUserContact().getEmailAddress()));
+ throw new IllegalArgumentException(MessageFormat.format("Email address {0} already added.", user.getUserContact().getContactEmailAddress()));
}
// Add user name
this.userNameList.add(user.getUserName());
// Add email addres
- this.emailAddressList.add(user.getUserContact().getEmailAddress());
+ this.emailAddressList.add(user.getUserContact().getContactEmailAddress());
}
@Override
// Copy all fields:
// - base data
this.setUserId(user.getUserId());
- this.setGender(user.getUserContact().getGender());
- this.setFirstName(user.getUserContact().getFirstName());
- this.setFamilyName(user.getUserContact().getFamilyName());
- this.setStreet(user.getUserContact().getStreet());
- this.setHouseNumber(user.getUserContact().getHouseNumber());
- this.setZipCode(user.getUserContact().getZipCode());
- this.setCity(user.getUserContact().getCity());
- this.setCountry(user.getUserContact().getCountry());
+ this.setGender(user.getUserContact().getContactGender());
+ this.setFirstName(user.getUserContact().getContactFirstName());
+ this.setFamilyName(user.getUserContact().getContactFamilyName());
+ this.setStreet(user.getUserContact().getContactStreet());
+ this.setHouseNumber(user.getUserContact().getContactHouseNumber());
+ this.setZipCode(user.getUserContact().getContactZipCode());
+ this.setCity(user.getUserContact().getContactCity());
+ this.setCountry(user.getUserContact().getContactCountry());
// Get cellphone, phone and fax instance
- DialableCellphoneNumber cellphone = user.getUserContact().getCellphoneNumber();
- DialableFaxNumber fax = user.getUserContact().getFaxNumber();
- DialableLandLineNumber phone = user.getUserContact().getPhoneNumber();
+ DialableCellphoneNumber cellphone = user.getUserContact().getContactCellphoneNumber();
+ DialableFaxNumber fax = user.getUserContact().getContactFaxNumber();
+ DialableLandLineNumber phone = user.getUserContact().getContactPhoneNumber();
// - contact data
if (phone instanceof DialableLandLineNumber) {
this.setFaxAreaCode(fax.getPhoneAreaCode());
this.setFaxNumber(fax.getPhoneNumber());
}
- this.setEmailAddress(user.getUserContact().getEmailAddress());
+ this.setEmailAddress(user.getUserContact().getContactEmailAddress());
// -- other data
- this.setBirthday(user.getUserContact().getBirthday());
- this.setComment(user.getUserContact().getComment());
+ this.setBirthday(user.getUserContact().getContactBirthday());
+ this.setComment(user.getUserContact().getContactComment());
}
@Override
// Create new contact
Contact contact = new UserContact(this.getGender(), this.getFirstName(), this.getFamilyName());
- contact.setStreet(this.getStreet());
- contact.setHouseNumber(this.getHouseNumber());
- contact.setZipCode(this.getZipCode());
- contact.setCity(this.getCity());
- contact.setCountry(this.getCountry());
- contact.setEmailAddress(this.getEmailAddress());
- contact.setPhoneNumber(phone);
- contact.setFaxNumber(fax);
- contact.setCellphoneNumber(cellphone);
- contact.setBirthday(this.getBirthday());
- contact.setComment(this.getComment());
+ contact.setContactStreet(this.getStreet());
+ contact.setContactHouseNumber(this.getHouseNumber());
+ contact.setContactZipCode(this.getZipCode());
+ contact.setContactCity(this.getCity());
+ contact.setContactCountry(this.getCountry());
+ contact.setContactEmailAddress(this.getEmailAddress());
+ contact.setContactPhoneNumber(phone);
+ contact.setContactFaxNumber(fax);
+ contact.setContactCellphoneNumber(cellphone);
+ contact.setContactBirthday(this.getBirthday());
+ contact.setContactComment(this.getComment());
// Created timestamp and ownContact
- contact.setCreated(new GregorianCalendar());
- contact.setOwnContact(Boolean.TRUE);
+ contact.setContactCreated(new GregorianCalendar());
+ contact.setContactOwnContact(Boolean.TRUE);
// Set contact in user
user.setUserContact(contact);
@Override
public boolean isEmailAddressRegistered (final User user) {
- return ((this.emailAddressList instanceof List) && (this.emailAddressList.contains(user.getUserContact().getEmailAddress())));
+ return ((this.emailAddressList instanceof List) && (this.emailAddressList.contains(user.getUserContact().getContactEmailAddress())));
}
@Override