Skip to content
This repository was archived by the owner on Apr 19, 2018. It is now read-only.

BlockingObservable and NbpBlockingObservable use Optional.stream() #4

Open
JakeWharton opened this issue Oct 10, 2015 · 3 comments
Open

Comments

@JakeWharton
Copy link
Owner

While the implementation could probably be changed upstream as the steam is just convenience, this needs reconciled either way.

@JakeWharton
Copy link
Owner Author

Another fix would just be to implement a subset of the stream API in the runtime. Then we don't have to rewrite anything...

@JakeWharton
Copy link
Owner Author

Each

  public Optional<T> firstOption() {
    return this.stream().findFirst();
  }

Needs rewritten to

  public Optional<T> firstOption() {
    return Iterables.firstOption(this);
  }

Where Iterables.firstOption is a util class in our runtime.

@JakeWharton
Copy link
Owner Author

Each

  public Optional<T> lastOption() {
    return this.stream().reduce((a, b) -> {
      return b;
    });
  }

Needs rewritten to

  public Optional<T> lastOption() {
    return Iterables.lastOption(this);
  }

Where Iterables.lastOption is a util class in our runtime.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant