You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by jb...@apache.org on 2020/08/17 06:22:42 UTC
[karaf-cellar] branch master updated: [KARAF-4874] Add comparable
on the cluster log key
This is an automated email from the ASF dual-hosted git repository.
jbonofre pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/karaf-cellar.git
The following commit(s) were added to refs/heads/master by this push:
new 47730d1 [KARAF-4874] Add comparable on the cluster log key
47730d1 is described below
commit 47730d1a797c7aab7a7da2f44a68f459fb9c4f38
Author: jbonofre <jb...@apache.org>
AuthorDate: Mon Aug 17 08:22:06 2020 +0200
[KARAF-4874] Add comparable on the cluster log key
---
log/src/main/java/org/apache/karaf/cellar/log/ClusterLogKey.java | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/log/src/main/java/org/apache/karaf/cellar/log/ClusterLogKey.java b/log/src/main/java/org/apache/karaf/cellar/log/ClusterLogKey.java
index 662d095..dde698e 100644
--- a/log/src/main/java/org/apache/karaf/cellar/log/ClusterLogKey.java
+++ b/log/src/main/java/org/apache/karaf/cellar/log/ClusterLogKey.java
@@ -18,7 +18,7 @@ package org.apache.karaf.cellar.log;
import java.io.Serializable;
-public class ClusterLogKey implements Serializable {
+public class ClusterLogKey implements Serializable, Comparable<ClusterLogKey> {
private String nodeId;
private String nodeAlias;
@@ -57,4 +57,9 @@ public class ClusterLogKey implements Serializable {
this.id = id;
}
+ @Override
+ public int compareTo(ClusterLogKey o) {
+ return new Long(this.timeStamp - o.timeStamp).intValue();
+ }
+
}