Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 4f07e5a5 authored by Guillaume Thomazon's avatar Guillaume Thomazon
Browse files

Add messages comparaison

git-svn-id: https://scm.gforge.inria.fr/authscm/ycadoret/svn/gazelle/Maven/gazelle-proxy/trunk@33599 356b4b1a-1d2b-0410-8bf1-ffa24008f01e
parent 1ad2221f
No related branches found
No related tags found
No related merge requests found
......@@ -56,7 +56,7 @@ import org.slf4j.LoggerFactory;
@Inheritance
@DiscriminatorColumn(name = "pxy_abstract_message_type")
@SequenceGenerator(name = "pxy_message_sequence", sequenceName = "pxy_message_id_seq", allocationSize = 1)
public abstract class AbstractMessage {
public abstract class AbstractMessage implements Comparable<AbstractMessage> {
private static Logger log = LoggerFactory.getLogger(AbstractMessage.class);
......@@ -67,7 +67,7 @@ public abstract class AbstractMessage {
@NotNull
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "pxy_message_sequence")
private Integer id;
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "date_received")
private Date dateReceived;
......@@ -314,6 +314,11 @@ public abstract class AbstractMessage {
return new ByteArrayPartSource(messageType, messageReceived);
}
@Override
public int compareTo(AbstractMessage o) {
return getDateReceived().compareTo(o.getDateReceived());
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment