
org.zwobble.mammoth.internal.documents.Notes Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mammoth Show documentation
Show all versions of mammoth Show documentation
Convert Word documents to simple and clean HTML
The newest version!
package org.zwobble.mammoth.internal.documents;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import static org.zwobble.mammoth.internal.util.Lists.list;
import static org.zwobble.mammoth.internal.util.Maps.*;
public class Notes {
public final static Notes EMPTY = new Notes(list());
private final Map> notes;
public Notes(List notes) {
this.notes = eagerMapValues(
toMultiMapWithKey(notes, Note::getNoteType),
notesOfType -> toMapWithKey(notesOfType, Note::getId));
}
public Optional findNote(NoteType noteType, String noteId) {
return lookup(notes, noteType)
.flatMap(notesOfType -> lookup(notesOfType, noteId));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy