Skip to content
Permalink
Browse files

Added convenience method: non-null values of Val

  • Loading branch information...
JordanMartinez committed Dec 28, 2016
1 parent b0fa941 commit 8aa339ad1d0ebe5de8ebf0f0f44cb9e9e2f198e6
Showing with 9 additions and 0 deletions.
  1. +9 −0 reactfx/src/main/java/org/reactfx/value/Val.java
@@ -123,6 +123,15 @@ protected Subscription observeInputs() {
return EventStreams.valuesOf(this);
}

/**
* Returns a stream of non-null values of this {@linkplain Val}. The returned stream
* emits the current value of this {@linkplain Val} if it is not null for each new subscriber
* and then the new value if it is not null whenever the value changes.
*/
default EventStream<T> nonNullValues() {
return EventStreams.nonNullValuesOf(this);
}

/**
* Checks whether this {@linkplain Val} holds a (non-null) value.
* @return {@code true} if this {@linkplain Val} holds a (non-null) value,

0 comments on commit 8aa339a

Please sign in to comment.
You can’t perform that action at this time.