]> git.mxchange.org Git - juser-activity-core.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Fri, 22 Sep 2017 22:00:51 +0000 (00:00 +0200)
committerRoland Häder <roland@mxchange.org>
Fri, 22 Sep 2017 22:03:01 +0000 (00:03 +0200)
- need to change java.util.Calendar (bye bye) to java.util.Date in favour of
  PrimeFaces' p:calendar [!] tag

Signed-off-by: Roland Häder <roland@mxchange.org>
src/org/mxchange/jusercore/model/user/activity/LogableUserActivity.java
src/org/mxchange/jusercore/model/user/activity/UserActivityLog.java
src/org/mxchange/jusercore/model/user/activity/comparator/UserActivityLogTimestampComparator.java

index c85573a0bac05a134e795675e266d04422ee5d56..31a602f45932587245ab003df1a9cadc9d602717 100644 (file)
@@ -17,7 +17,7 @@
 package org.mxchange.jusercore.model.user.activity;
 
 import java.io.Serializable;
-import java.util.Calendar;
+import java.util.Date;
 import org.mxchange.jcontacts.model.contact.title.PersonalTitle;
 import org.mxchange.jusercore.model.user.User;
 
@@ -75,14 +75,14 @@ public interface LogableUserActivity extends Serializable {
         * <p>
         * @return Activity timestamp
         */
-       Calendar getActivityTimestamp ();
+       Date getActivityTimestamp ();
 
        /**
         * Setter for activity timestamp
         * <p>
         * @param activityTimestamp Activity timestamp
         */
-       void setActivityTimestamp (final Calendar activityTimestamp);
+       void setActivityTimestamp (final Date activityTimestamp);
 
        /**
         * Getter for activity type
index 24c01f447d6d64416cae77a22cb4bc2e3ea4cde4..a5e56ceda600ef1c55fd7889d6f427092bd83086 100644 (file)
@@ -17,7 +17,7 @@
 package org.mxchange.jusercore.model.user.activity;
 
 import java.text.MessageFormat;
-import java.util.Calendar;
+import java.util.Date;
 import java.util.Objects;
 import javax.persistence.Basic;
 import javax.persistence.CascadeType;
@@ -118,7 +118,7 @@ public class UserActivityLog implements LogableUserActivity {
        @Basic (optional = false)
        @Temporal (TemporalType.TIMESTAMP)
        @Column (name = "activity_timestamp", nullable = false, updatable = false)
-       private Calendar activityTimestamp;
+       private Date activityTimestamp;
 
        /**
         * Type
@@ -155,7 +155,7 @@ public class UserActivityLog implements LogableUserActivity {
         * @param activityUser User instance
         * @param activityTimestamp imestamp
         */
-       public UserActivityLog (final String activityMessage, final String activityType, final User activityUser, final Calendar activityTimestamp) {
+       public UserActivityLog (final String activityMessage, final String activityType, final User activityUser, final Date activityTimestamp) {
                // Call other constructor
                this(activityType, activityUser, activityTimestamp);
 
@@ -179,7 +179,7 @@ public class UserActivityLog implements LogableUserActivity {
         * @param activityUser User instance
         * @param activityTimestamp imestamp
         */
-       public UserActivityLog (final String activityType, final User activityUser, final Calendar activityTimestamp) {
+       public UserActivityLog (final String activityType, final User activityUser, final Date activityTimestamp) {
                // Make sure all is set
                if (null == activityType) {
                        // Throw NPE
@@ -231,7 +231,7 @@ public class UserActivityLog implements LogableUserActivity {
         * @param activityTimestamp imestamp
         * @param principalName Principal name
         */
-       public UserActivityLog (final String activityMessage, final String activityType, final User activityUser, final Calendar activityTimestamp, final String principalName) {
+       public UserActivityLog (final String activityMessage, final String activityType, final User activityUser, final Date activityTimestamp, final String principalName) {
                // Call other constructor
                this(activityMessage, activityType, activityUser, activityTimestamp);
 
@@ -247,7 +247,7 @@ public class UserActivityLog implements LogableUserActivity {
         * @param activityTimestamp imestamp
         * @param principalName Principal name
         */
-       public UserActivityLog (final String activityType, final User activityUser, final Calendar activityTimestamp, final String principalName) {
+       public UserActivityLog (final String activityType, final User activityUser, final Date activityTimestamp, final String principalName) {
                // Call other constructor
                this(activityType, activityUser, activityTimestamp);
 
@@ -346,13 +346,13 @@ public class UserActivityLog implements LogableUserActivity {
 
        @Override
        @SuppressWarnings ("ReturnOfDateField")
-       public Calendar getActivityTimestamp () {
+       public Date getActivityTimestamp () {
                return this.activityTimestamp;
        }
 
        @Override
        @SuppressWarnings ("AssignmentToDateFieldFromParameter")
-       public void setActivityTimestamp (final Calendar activityTimestamp) {
+       public void setActivityTimestamp (final Date activityTimestamp) {
                this.activityTimestamp = activityTimestamp;
        }
 
index df4a2a402b29b26614522337d2f4b25240aece2b..ca24eb62a694bec1f14c3b1ca4662e2973a9cebc 100644 (file)
@@ -28,7 +28,7 @@ public class UserActivityLogTimestampComparator implements Comparator<LogableUse
 
        @Override
        public int compare (final LogableUserActivity userActivity1, final LogableUserActivity userActivity2) {
-               return (userActivity1.getActivityTimestamp().getTime().getTime() < userActivity2.getActivityTimestamp().getTime().getTime() ? -1 : userActivity1.getActivityTimestamp().getTime().getTime() == userActivity2.getActivityTimestamp().getTime().getTime() ? 0 : 1);
+               return (userActivity1.getActivityTimestamp().getTime() < userActivity2.getActivityTimestamp().getTime() ? -1 : userActivity1.getActivityTimestamp().getTime() == userActivity2.getActivityTimestamp().getTime() ? 0 : 1);
        }
 
 }