Support for reading and writing Hashtags from/to NoteDB

Change-Id: If8539f21bb29685d2fba8ab4d8612c3f588cb28b
This commit is contained in:
Gustaf Lundh
2014-09-09 10:26:57 +02:00
parent bcf97bd354
commit 8c9d00e005
5 changed files with 80 additions and 1 deletions

View File

@@ -22,6 +22,7 @@ import com.google.common.base.Function;
import com.google.common.collect.ComparisonChain;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableListMultimap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.ImmutableSetMultimap;
import com.google.common.collect.Ordering;
import com.google.common.collect.Table;
@@ -138,6 +139,7 @@ public class ChangeNotes extends AbstractChangeNotes<ChangeNotes> {
private ImmutableListMultimap<PatchSet.Id, ChangeMessage> changeMessages;
private ImmutableListMultimap<PatchSet.Id, PatchLineComment> commentsForBase;
private ImmutableListMultimap<PatchSet.Id, PatchLineComment> commentsForPS;
private ImmutableSet<String> hashtags;
NoteMap noteMap;
private final AllUsersName allUsers;
@@ -163,6 +165,10 @@ public class ChangeNotes extends AbstractChangeNotes<ChangeNotes> {
return reviewers;
}
public ImmutableSet<String> getHashtags() {
return hashtags;
}
/**
* @return a list of all users who have ever been a reviewer on this change.
*/
@@ -275,6 +281,11 @@ public class ChangeNotes extends AbstractChangeNotes<ChangeNotes> {
commentsForPS = ImmutableListMultimap.copyOf(parser.commentsForPs);
noteMap = parser.commentNoteMap;
if (parser.hashtags != null) {
hashtags = ImmutableSet.copyOf(parser.hashtags);
} else {
hashtags = ImmutableSet.of();
}
ImmutableSetMultimap.Builder<ReviewerState, Account.Id> reviewers =
ImmutableSetMultimap.builder();
for (Map.Entry<Account.Id, ReviewerState> e