File tree Expand file tree Collapse file tree
src/main/java/org/spongepowered/api/data/value Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3636import java .util .OptionalInt ;
3737import java .util .OptionalLong ;
3838import java .util .Set ;
39+ import java .util .stream .Stream ;
3940
4041/**
4142 * A value holder is a holder of a particular set of {@link Value}s. While
@@ -215,6 +216,15 @@ default boolean supports(final Value<?> value) {
215216 */
216217 Set <Key <?>> getKeys ();
217218
219+ /**
220+ * Gets all applicable {@link Key}s for this {@link ValueContainer}.
221+ *
222+ * @return A stream of known {@link Key}s
223+ */
224+ default Stream <Key <?>> streamKeys () {
225+ return this .getKeys ().stream ();
226+ }
227+
218228 /**
219229 * Gets all applicable {@link Value}s associated with this
220230 * {@link ValueContainer}. As the data backed by the values are copied,
@@ -224,4 +234,16 @@ default boolean supports(final Value<?> value) {
224234 * @return An immutable set of copied values
225235 */
226236 Set <Value .Immutable <?>> getValues ();
237+
238+ /**
239+ * Gets all applicable {@link Value}s associated with this
240+ * {@link ValueContainer}. As the data backed by the values are copied,
241+ * any modifications to the {@link Value}s will not be reflected onto
242+ * this {@link ValueContainer}.
243+ *
244+ * @return A stream of copied values
245+ */
246+ default Stream <Value .Immutable <?>> streamValues () {
247+ return this .getValues ().stream ();
248+ }
227249}
You can’t perform that action at this time.
0 commit comments