Address review comments

This commit is contained in:
Torsten Grote
2016-10-06 12:03:04 -03:00
parent 784561144a
commit 7f2db71160
41 changed files with 171 additions and 159 deletions

View File

@@ -2,6 +2,7 @@ package org.briarproject.api.clients;
import org.briarproject.api.sync.GroupId;
import org.briarproject.api.sync.MessageId;
import org.jetbrains.annotations.NotNull;
public abstract class BaseMessageHeader {
@@ -10,8 +11,9 @@ public abstract class BaseMessageHeader {
private final long timestamp;
private final boolean local, read, sent, seen;
public BaseMessageHeader(MessageId id, GroupId groupId, long timestamp,
boolean local, boolean read, boolean sent, boolean seen) {
public BaseMessageHeader(@NotNull MessageId id, @NotNull GroupId groupId,
long timestamp, boolean local, boolean read, boolean sent,
boolean seen) {
this.id = id;
this.groupId = groupId;
@@ -22,10 +24,12 @@ public abstract class BaseMessageHeader {
this.seen = seen;
}
@NotNull
public MessageId getId() {
return id;
}
@NotNull
public GroupId getGroupId() {
return groupId;
}

View File

@@ -1,9 +1,7 @@
package org.briarproject.api.clients;
import org.briarproject.api.db.DbException;
import org.briarproject.api.db.Transaction;
import org.briarproject.api.sync.GroupId;
import org.briarproject.api.sync.Message;
import org.briarproject.api.sync.MessageId;
public interface MessageTracker {
@@ -20,19 +18,20 @@ public interface MessageTracker {
void setReadFlag(GroupId g, MessageId m, boolean read) throws DbException;
class GroupCount {
private final long msgCount, unreadCount, latestMsgTime;
private final int msgCount, unreadCount;
private final long latestMsgTime;
public GroupCount(long msgCount, long unreadCount, long latestMsgTime) {
public GroupCount(int msgCount, int unreadCount, long latestMsgTime) {
this.msgCount = msgCount;
this.unreadCount = unreadCount;
this.latestMsgTime = latestMsgTime;
}
public long getMsgCount() {
public int getMsgCount() {
return msgCount;
}
public long getUnreadCount() {
public int getUnreadCount() {
return unreadCount;
}