From 0deccc08a51e68eb97ad6ef5a95bfd868a939169 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Fri, 25 Mar 2016 16:43:24 +0000 Subject: Remove use of Google collections in Notes --- .../java/org/zwobble/mammoth/internal/documents/Notes.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/main/java/org/zwobble/mammoth/internal/documents/Notes.java') diff --git a/src/main/java/org/zwobble/mammoth/internal/documents/Notes.java b/src/main/java/org/zwobble/mammoth/internal/documents/Notes.java index d7de8a6..fdfa814 100644 --- a/src/main/java/org/zwobble/mammoth/internal/documents/Notes.java +++ b/src/main/java/org/zwobble/mammoth/internal/documents/Notes.java @@ -1,14 +1,11 @@ package org.zwobble.mammoth.internal.documents; -import com.google.common.collect.Maps; -import com.google.common.collect.Multimaps; - import java.util.List; import java.util.Map; import java.util.Optional; import static org.zwobble.mammoth.internal.util.MammothLists.list; -import static org.zwobble.mammoth.internal.util.MammothMaps.lookup; +import static org.zwobble.mammoth.internal.util.MammothMaps.*; public class Notes { public final static Notes EMPTY = new Notes(list()); @@ -16,9 +13,9 @@ public class Notes { private final Map> notes; public Notes(List notes) { - this.notes = Maps.transformValues( - Multimaps.index(notes, Note::getNoteType).asMap(), - notesOfType -> Maps.uniqueIndex(notesOfType, Note::getId)); + this.notes = eagerMapValues( + toMultiMapWithKey(notes, Note::getNoteType), + notesOfType -> toMapWithKey(notesOfType, Note::getId)); } public Optional findNote(NoteType noteType, String noteId) { -- cgit v1.2.3