You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by bt...@apache.org on 2018/05/10 02:31:13 UTC
[06/15] james-project git commit: MAILBOX-332 EventId should be an int
MAILBOX-332 EventId should be an int
Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/17ff45f4
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/17ff45f4
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/17ff45f4
Branch: refs/heads/master
Commit: 17ff45f49f6ec31014ed03f15413a46506a7a93d
Parents: 4b9c3f7
Author: Matthieu Baechler <ma...@apache.org>
Authored: Wed May 9 14:37:00 2018 +0200
Committer: benwa <bt...@linagora.com>
Committed: Thu May 10 09:15:22 2018 +0700
----------------------------------------------------------------------
.../java/org/apache/james/eventsourcing/EventId.java | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/james-project/blob/17ff45f4/mailbox/plugin/quota-mailing/src/main/java/org/apache/james/eventsourcing/EventId.java
----------------------------------------------------------------------
diff --git a/mailbox/plugin/quota-mailing/src/main/java/org/apache/james/eventsourcing/EventId.java b/mailbox/plugin/quota-mailing/src/main/java/org/apache/james/eventsourcing/EventId.java
index 1d636f6..cb5bd1e 100644
--- a/mailbox/plugin/quota-mailing/src/main/java/org/apache/james/eventsourcing/EventId.java
+++ b/mailbox/plugin/quota-mailing/src/main/java/org/apache/james/eventsourcing/EventId.java
@@ -27,13 +27,17 @@ import com.google.common.base.Preconditions;
public class EventId implements Comparable<EventId> {
+ public static EventId fromSerialized(int value) {
+ return new EventId(value);
+ }
+
public static EventId first() {
return new EventId(0);
}
- private final long value;
+ private final int value;
- private EventId(long value) {
+ private EventId(int value) {
Preconditions.checkArgument(value >= 0, "EventId can not be negative");
this.value = value;
}
@@ -75,4 +79,8 @@ public class EventId implements Comparable<EventId> {
.add("value", value)
.toString();
}
+
+ public int serialize() {
+ return value;
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org