package org.mxchange.jusercore.model.email_address;
import java.io.Serializable;
-import java.util.Calendar;
+import java.util.Date;
import org.mxchange.jusercore.model.email_address.status.EmailChangeStatus;
import org.mxchange.jusercore.model.user.User;
* <p>
* @return Created "email change" timestamp
*/
- Calendar getEmailChangeCreated ();
+ Date getEmailChangeCreated ();
/**
* Setter for created "email change" timestamp
* <p>
* @param emailChangeCreated Created "email change" timestamp
*/
- void setEmailChangeCreated (final Calendar emailChangeCreated);
+ void setEmailChangeCreated (final Date emailChangeCreated);
/**
* Getter for user initiating the email change
* <p>
* @return Email change done/undone
*/
- Calendar getEmailChangeDone ();
+ Date getEmailChangeDone ();
/**
* Setter for email change done/undone
* <p>
* @param emailChangeDone Email change done/undone
*/
- void setEmailChangeDone (final Calendar emailChangeDone);
+ void setEmailChangeDone (final Date emailChangeDone);
/**
* Getter for email change status
*/
package org.mxchange.jusercore.model.email_address;
-import java.util.Calendar;
+import java.util.Date;
import java.util.Objects;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
@Basic (optional = false)
@Temporal (TemporalType.TIMESTAMP)
@Column (name = "email_change_created", nullable = false, updatable = false)
- private Calendar emailChangeCreated;
+ private Date emailChangeCreated;
/**
* Timestamp when this change has been done or undone
@Basic (optional = false)
@Temporal (TemporalType.TIMESTAMP)
@Column (name = "email_change_done", nullable = false, updatable = false)
- private Calendar emailChangeDone;
+ private Date emailChangeDone;
/**
* Email change hash the user has to click
* @param emailChangeDone When this entry has been done
* @param emailChangeHash Email change hash
*/
- public EmailAddressChange (final Long emailChangeId, final User user, final String emailAddress, final Calendar emailChangeCreated, final EmailChangeStatus emailChangeStatus, final Calendar emailChangeDone, final String emailChangeHash) {
+ public EmailAddressChange (final Long emailChangeId, final User user, final String emailAddress, final Date emailChangeCreated, final EmailChangeStatus emailChangeStatus, final Date emailChangeDone, final String emailChangeHash) {
// Call other constructor
this(user, emailAddress);
@Override
@SuppressWarnings ("ReturnOfDateField")
- public Calendar getEmailChangeCreated () {
+ public Date getEmailChangeCreated () {
return this.emailChangeCreated;
}
@Override
@SuppressWarnings ("AssignmentToDateFieldFromParameter")
- public void setEmailChangeCreated (final Calendar emailChangeCreated) {
+ public void setEmailChangeCreated (final Date emailChangeCreated) {
this.emailChangeCreated = emailChangeCreated;
}
@Override
@SuppressWarnings ("ReturnOfDateField")
- public Calendar getEmailChangeDone () {
+ public Date getEmailChangeDone () {
return this.emailChangeDone;
}
@Override
@SuppressWarnings ("AssignmentToDateFieldFromParameter")
- public void setEmailChangeDone (final Calendar emailChangeDone) {
+ public void setEmailChangeDone (final Date emailChangeDone) {
this.emailChangeDone = emailChangeDone;
}
*/
package org.mxchange.jusercore.model.user;
-import java.util.Calendar;
+import java.util.Date;
import java.util.Locale;
import java.util.Objects;
import javax.persistence.Basic;
@Basic (optional = false)
@Temporal (TemporalType.TIMESTAMP)
@Column (name = "user_created", nullable = false, updatable = false)
- private Calendar userCreated;
+ private Date userCreated;
/**
* Encrypted password
*/
@Temporal (TemporalType.TIMESTAMP)
@Column (name = "user_last_locked_timestamp")
- private Calendar userLastLocked;
+ private Date userLastLocked;
/**
* Last locked reason
*/
@Temporal (TemporalType.TIMESTAMP)
@Column (name = "user_updated", insertable = false)
- private Calendar userUpdated;
+ private Date userUpdated;
/**
* Default constructor
@Override
@SuppressWarnings ("ReturnOfDateField")
- public Calendar getUserCreated () {
+ public Date getUserCreated () {
return this.userCreated;
}
@Override
@SuppressWarnings ("AssignmentToDateFieldFromParameter")
- public void setUserCreated (final Calendar userCreated) {
+ public void setUserCreated (final Date userCreated) {
this.userCreated = userCreated;
}
@Override
@SuppressWarnings ("ReturnOfDateField")
- public Calendar getUserLastLocked () {
+ public Date getUserLastLocked () {
return this.userLastLocked;
}
@Override
@SuppressWarnings ("AssignmentToDateFieldFromParameter")
- public void setUserLastLocked (final Calendar userLastLocked) {
+ public void setUserLastLocked (final Date userLastLocked) {
this.userLastLocked = userLastLocked;
}
@Override
@SuppressWarnings ("ReturnOfDateField")
- public Calendar getUserUpdated () {
+ public Date getUserUpdated () {
return this.userUpdated;
}
@Override
@SuppressWarnings ("AssignmentToDateFieldFromParameter")
- public void setUserUpdated (final Calendar userUpdated) {
+ public void setUserUpdated (final Date userUpdated) {
this.userUpdated = userUpdated;
}
package org.mxchange.jusercore.model.user;
import java.io.Serializable;
-import java.util.Calendar;
+import java.util.Date;
import java.util.Locale;
import org.mxchange.jcontacts.model.contact.Contact;
import org.mxchange.jusercore.model.user.profilemodes.ProfileMode;
* <p>
* @return "created" timestamp
*/
- Calendar getUserCreated ();
+ Date getUserCreated ();
/**
* Setter for "created" timestamp
* <p>
* @param userCreated "created" timestamp
*/
- void setUserCreated (final Calendar userCreated);
+ void setUserCreated (final Date userCreated);
/**
* Getter for encrypted password
* <p>
* @return "locked" timestamp
*/
- Calendar getUserLastLocked ();
+ Date getUserLastLocked ();
/**
* Getter for "locked" timestamp
* <p>
* @param userLocked "locked" timestamp
*/
- void setUserLastLocked (final Calendar userLocked);
+ void setUserLastLocked (final Date userLocked);
/**
* Getter for reason of last locked
* <p>
* @return Updated timestamp
*/
- Calendar getUserUpdated ();
+ Date getUserUpdated ();
/**
* Setter for updated timestamp
* <p>
* @param userUpdated Updated timestamp
*/
- void setUserUpdated (final Calendar userUpdated);
+ void setUserUpdated (final Date userUpdated);
/**
* Getter for user's locale
import java.security.SecureRandom;
import java.text.DateFormat;
import java.text.MessageFormat;
-import java.util.Calendar;
+import java.util.Date;
import java.util.Properties;
import java.util.Random;
import org.mxchange.jcontacts.model.contact.Contact;
}
/**
- * Returns a formatted string from given user's locale and Calendar instance
+ * Returns a formatted string from given user's locale and Date instance
* <p>
* @param user User instance
- * @param calendar Calendar instance
+ * @param date Date instance
* <p>
- * @return A formatted string from Calendar instance
+ * @return A formatted string from Date instance
*/
- public static String getFormattedTimestampFromUser (final User user, final Calendar calendar) {
+ public static String getFormattedTimestampFromUser (final User user, final Date date) {
// Get formatter
DateFormat format = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM, user.getUserLocale());
// Now simply format the calendar's Time (not just time) field
- String dateTime = format.format(calendar.getTime());
+ String dateTime = format.format(date.getTime());
// Return it
return dateTime;
package org.mxchange.jusercore.model.user.password_history;
import java.io.Serializable;
-import java.util.Calendar;
+import java.util.Date;
import org.mxchange.jusercore.model.user.User;
/**
* <p>
* @return Timestamp when this history entry has been created
*/
- Calendar getUserPasswordHistoryCreated ();
+ Date getUserPasswordHistoryCreated ();
/**
* Setter for timestamp this history entry has been created (usually in
* @param userPasswordHistoryCreated Timestamp when this history entry has
* been created
*/
- void setUserPasswordHistoryCreated (final Calendar userPasswordHistoryCreated);
+ void setUserPasswordHistoryCreated (final Date userPasswordHistoryCreated);
/**
* Getter for history entry id (primary key)
*/
package org.mxchange.jusercore.model.user.password_history;
-import java.util.Calendar;
+import java.util.Date;
import java.util.Objects;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
@Basic (optional = false)
@Column (name = "history_created", nullable = false, updatable = false)
@Temporal (TemporalType.TIMESTAMP)
- private Calendar userPasswordHistoryCreated;
+ private Date userPasswordHistoryCreated;
/**
* Id number (primary key)
@Override
@SuppressWarnings ("ReturnOfDateField")
- public Calendar getUserPasswordHistoryCreated () {
+ public Date getUserPasswordHistoryCreated () {
return this.userPasswordHistoryCreated;
}
@Override
@SuppressWarnings ("AssignmentToDateFieldFromParameter")
- public void setUserPasswordHistoryCreated (final Calendar userPasswordHistoryCreated) {
+ public void setUserPasswordHistoryCreated (final Date userPasswordHistoryCreated) {
this.userPasswordHistoryCreated = userPasswordHistoryCreated;
}