Skip to content
Permalink
Browse files

Merge pull request #62 from JordanMartinez/nonNullValues

Added convenience method: non-null values of Val
  • Loading branch information...
TomasMikula committed Dec 29, 2016
2 parents b0fa941 + 8aa339a commit 537fffdbb2958a77dfbca08b712bb2192862e960
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 537fffd

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