Skip to content

Commit

Permalink
3.x: Update the javadoc description of cast()
Browse files Browse the repository at this point in the history
  • Loading branch information
akarnokd committed Oct 4, 2023
1 parent e6f152d commit 555e196
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
9 changes: 5 additions & 4 deletions src/main/java/io/reactivex/rxjava3/core/Flowable.java
Original file line number Diff line number Diff line change
Expand Up @@ -7475,8 +7475,10 @@ public final Flowable<T> cacheWithInitialCapacity(int initialCapacity) {
}

/**
* Returns a {@code Flowable} that emits the items emitted by the current {@code Flowable}, converted to the specified
* type.
* Returns a {@code Flowable} that emits the upstream items while
* they can be cast via {@link Class#cast(Object)} until the upstream terminates,
* or until the upstream signals an item which can't be cast,
* resulting in a {@link ClassCastException} to be signaled to the downstream.
* <p>
* <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/cast.v3.png" alt="">
* <dl>
Expand All @@ -7489,8 +7491,7 @@ public final Flowable<T> cacheWithInitialCapacity(int initialCapacity) {
*
* @param <U> the output value type cast to
* @param clazz
* the target class type that {@code cast} will cast the items emitted by the current {@code Flowable}
* into before emitting them from the resulting {@code Flowable}
* the target class to use to try and cast the upstream items into
* @return the new {@code Flowable} instance
* @throws NullPointerException if {@code clazz} is {@code null}
* @see <a href="http://reactivex.io/documentation/operators/map.html">ReactiveX operators documentation: Map</a>
Expand Down
9 changes: 5 additions & 4 deletions src/main/java/io/reactivex/rxjava3/core/Observable.java
Original file line number Diff line number Diff line change
Expand Up @@ -6668,8 +6668,10 @@ public final Observable<T> cacheWithInitialCapacity(int initialCapacity) {
}

/**
* Returns an {@code Observable} that emits the items emitted by the current {@code Observable}, converted to the specified
* type.
* Returns an {@code Observable} that emits the upstream items while
* they can be cast via {@link Class#cast(Object)} until the upstream terminates,
* or until the upstream signals an item which can't be cast,
* resulting in a {@link ClassCastException} to be signaled to the downstream.
* <p>
* <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/cast.v3.png" alt="">
* <dl>
Expand All @@ -6679,8 +6681,7 @@ public final Observable<T> cacheWithInitialCapacity(int initialCapacity) {
*
* @param <U> the output value type cast to
* @param clazz
* the target class type that {@code cast} will cast the items emitted by the current {@code Observable}
* into before emitting them from the resulting {@code Observable}
* the target class to use to try and cast the upstream items into
* @return the new {@code Observable} instance
* @throws NullPointerException if {@code clazz} is {@code null}
* @see <a href="http://reactivex.io/documentation/operators/map.html">ReactiveX operators documentation: Map</a>
Expand Down

0 comments on commit 555e196

Please sign in to comment.