Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.x: [Java 8] Add fromOpt/Stage, mapOptional, toCompletionStage to M/S/C #6783

Merged
merged 1 commit into from
Dec 21, 2019

Conversation

akarnokd
Copy link
Member

Add the following Java 8 operators to various reactive base classes:

Operator Maybe Single Completable
fromOptional image (1) (2)
fromCompletionStage image image image
mapOptional image image (3)
toCompletionStage image image (4)
toCompletionStage(T) image (5) image
  1. Should it be implemented as Optional.empty() -> Single.error(new NoSuchElementException())?
  2. No reason to implement. Always Completable.complete().
  3. No value to map.
  4. No value to emit thus it is better to ask the user for a completion value.
  5. Never empty, no reason to implement.

Related #6776

Marbles:

image
image
image
image
image
image
image
image
image

@akarnokd akarnokd added Enhancement 3.x Java 8 Issues and PRs related to Java 8 support labels Dec 20, 2019
@akarnokd akarnokd added this to the 3.0 milestone Dec 20, 2019
@codecov
Copy link

codecov bot commented Dec 20, 2019

Codecov Report

Merging #6783 into 3.x will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##                3.x    #6783      +/-   ##
============================================
+ Coverage     98.24%   98.25%   +<.01%     
- Complexity     6255     6285      +30     
============================================
  Files           690      696       +6     
  Lines         45218    45390     +172     
  Branches       6220     6233      +13     
============================================
+ Hits          44426    44598     +172     
+ Misses          276      273       -3     
- Partials        516      519       +3
Impacted Files Coverage Δ Complexity Δ
...java3/internal/jdk8/SingleFromCompletionStage.java 100% <100%> (ø) 2 <2> (?)
src/main/java/io/reactivex/rxjava3/core/Maybe.java 100% <100%> (ø) 177 <5> (+5) ⬆️
...rc/main/java/io/reactivex/rxjava3/core/Single.java 100% <100%> (ø) 151 <3> (+3) ⬆️
...rxjava3/internal/jdk8/CompletionStageConsumer.java 100% <100%> (ø) 12 <12> (?)
...tivex/rxjava3/internal/jdk8/SingleMapOptional.java 100% <100%> (ø) 2 <2> (?)
...in/java/io/reactivex/rxjava3/core/Completable.java 100% <100%> (ø) 120 <2> (+2) ⬆️
...xjava3/internal/jdk8/MaybeFromCompletionStage.java 100% <100%> (ø) 2 <2> (?)
...ctivex/rxjava3/internal/jdk8/MaybeMapOptional.java 100% <100%> (ø) 2 <2> (?)
.../internal/jdk8/CompletableFromCompletionStage.java 100% <100%> (ø) 2 <2> (?)
.../operators/flowable/FlowableBlockingSubscribe.java 93.02% <0%> (-4.66%) 10% <0%> (-1%)
... and 31 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 166c529...4cd2024. Read the comment docs.

@akarnokd akarnokd merged commit 747f59e into ReactiveX:3.x Dec 21, 2019
@akarnokd akarnokd deleted the Jdk8ops_1220 branch December 21, 2019 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.x Enhancement Java 8 Issues and PRs related to Java 8 support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant