/*
- * Copyright (C) 2016 Cho-Time GmbH
+ * Copyright (C) 2016 Roland Haeder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/**
* POJI for logable user activity
* <p>
- * @author Roland Haeder<rhaeder@cho-time.de>
+ * @author Roland Haeder<roland@mxchange.org>
*/
public interface LogableUserActivity extends Serializable {
/*
- * Copyright (C) 2016 Cho-Time GmbH
+ * Copyright (C) 2016 Roland Haeder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/**
* A POJO for user acitivity log
* <p>
- * @author Roland Haeder<rhaeder@cho-time.de>
+ * @author Roland Haeder<roland@mxchange.org>
*/
@Entity (name = "user_activity_log")
@Table (
--- /dev/null
+/*\r
+ * Copyright (C) 2016 Roland Haeder\r
+ *\r
+ * This program is free software: you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation, either version 3 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.\r
+ */\r
+package org.mxchange.jusercore.model.user.activity.comparator;\r
+\r
+import java.util.Comparator;\r
+import org.mxchange.jusercore.model.user.activity.LogableUserActivity;\r
+\r
+/**\r
+ * A comparator for comparing timestamps in user activity log\r
+ * <p>\r
+ * @author Roland Haeder<roland@mxchange.org>\r
+ */\r
+public class UserActivityLogTimestampComparator implements Comparator<LogableUserActivity> {\r
+\r
+ @Override\r
+ public int compare (final LogableUserActivity userActivity1, final LogableUserActivity userActivity2) {\r
+ return (userActivity1.getActivityTimestamp().getTime().getTime() < userActivity2.getActivityTimestamp().getTime().getTime() ? -1 : userActivity1.getActivityTimestamp().getTime().getTime() == userActivity2.getActivityTimestamp().getTime().getTime() ? 0 : 1);\r
+ }\r
+\r
+}\r