Skip to content

Commit

Permalink
Added Stream support for NotesIDTable
Browse files Browse the repository at this point in the history
  • Loading branch information
klehmann committed Jan 13, 2021
1 parent 59394f9 commit 6c0a529
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions domino-jna/src/main/java/com/mindoo/domino/jna/NotesIDTable.java
Expand Up @@ -16,6 +16,8 @@
import java.util.Set;
import java.util.SortedSet;
import java.util.TreeSet;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;

import com.mindoo.domino.jna.NotesIDTable.IEnumerateCallback.Action;
import com.mindoo.domino.jna.NotesSearch.ISearchMatch;
Expand Down Expand Up @@ -1300,6 +1302,15 @@ public Iterator<Integer> iteratorBackwards() {
return new NoteIdIterator(this, true);
}

/**
* Returns a {@link Stream} of note ids
*
* @return stream
*/
public Stream<Integer> stream() {
return StreamSupport.stream(this.spliterator(), false);
}

private static class NoteIdIterator implements Iterator<Integer> {
private NotesIDTable m_idTable;
private IntByReference m_nextIdRef;
Expand Down

0 comments on commit 6c0a529

Please sign in to comment.