if (null == user) {
// Throw NPE
throw new NullPointerException("user is null"); //NOI18N
+ } else if (user.getUserEntryCreated() == null) {
+ // .. and again
+ throw new NullPointerException("user.userEntryCreated is null"); //NOI18N
} else if (user.getUserId() == null) {
// Throw NPE again
throw new NullPointerException("user.userId is null"); //NOI18N
} else if (user.getUserContact().getContactPersonalTitle() == null) {
// Throw NPE again
throw new NullPointerException("user.userContact.contactPersonalTitle is null"); //NOI18N
+ } else if (user.getUserContact().getContactEntryCreated() == null) {
+ // .. and again
+ throw new NullPointerException("user.userContact.contactEntryCreated is null"); //NOI18N
}
// Init properties list
final Properties properties = new Properties();
- // Init some vbalues with empty strings
+ // Init optional values with empty strings
properties.setProperty("userConfirmKey", ""); //NOI18N
properties.setProperty("userUpdated", ""); //NOI18N
properties.setProperty("userLastLockedReason", ""); //NOI18N
properties.setProperty("contactStreet", ""); //NOI18N
properties.setProperty("contactHouseNumber", ""); //NOI18N
properties.setProperty("contactCity", ""); //NOI18N
- // @TODO Unfinished:
- properties.setProperty("contactCountry", ""); //NOI18N
+ properties.setProperty("contactUpdated", ""); //NOI18N
properties.setProperty("contactZipCode", ""); //NOI18N
properties.setProperty("contactBirthday", ""); //NOI18N
properties.setProperty("contactEmailAddress", ""); //NOI18N
- properties.setProperty("contactUpdated", ""); //NOI18N
+ // @TODO Unfinished:
+ properties.setProperty("contactCountry", ""); //NOI18N
// Set all:
// - User data
if (user.getUserContact().getContactEmailAddress() != null) {
properties.setProperty("contactEmailAddress", user.getUserContact().getContactEmailAddress()); //NOI18N
}
- properties.setProperty("contactCreated", user.getUserContact().getContactEntryCreated().toString()); //NOI18N
+
+ // Timestamps:
+ properties.setProperty("contactCreated", formatTimestampFromUser(user, user.getUserContact().getContactEntryCreated())); //NOI18N
if (user.getUserContact().getContactEntryUpdated() != null) {
- properties.setProperty("contactUpdated", user.getUserContact().getContactEntryUpdated().toString()); //NOI18N
+ properties.setProperty("contactUpdated", formatTimestampFromUser(user, user.getUserContact().getContactEntryUpdated())); //NOI18N
}
// Return it