Skip to content

Commit 5f1eb3c

Browse files
committed
Add DataView#streamRootKeys
1 parent 356a8b4 commit 5f1eb3c

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

  • src/main/java/org/spongepowered/api/data/persistence

src/main/java/org/spongepowered/api/data/persistence/DataView.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,15 @@ public interface DataView {
107107
*/
108108
Set<DataQuery> keys(boolean deep);
109109

110+
/**
111+
* Gets a Stream containing all root keys for this {@link DataView}.
112+
*
113+
* @return Stream of root keys of this container
114+
*/
115+
default Stream<String> streamRootKeys() {
116+
return this.keys(false).stream().map(k -> k.parts().getFirst());
117+
}
118+
110119
/**
111120
* Gets a Map containing all keys and their values for this {@link DataView}.
112121
*

0 commit comments

Comments
 (0)