MCPcopy Index your code
hub / github.com/ReactiveX/RxJava / cast

Method cast

src/main/java/io/reactivex/rxjava3/core/Maybe.java:3060–3066  ·  view source on GitHub ↗

Casts the success value of the current Maybe into the target type or signals a ClassCastException if not compatible. Scheduler: {@c

(@NonNull Class<? extends U> clazz)

Source from the content-addressed store, hash-verified

3058 * @throws NullPointerException if {@code clazz} is {@code null}
3059 */
3060 @CheckReturnValue
3061 @NonNull
3062 @SchedulerSupport(SchedulerSupport.NONE)
3063 public final <@NonNull U> Maybe<U> cast(@NonNull Class<? extends U> clazz) {
3064 Objects.requireNonNull(clazz, "clazz is null");
3065 return map(Functions.castFunction(clazz));
3066 }
3067
3068 /**
3069 * Transform a {@code Maybe} by applying a particular {@link MaybeTransformer} function to it.

Callers 2

ofTypeMethod · 0.45
applyMethod · 0.45

Calls 2

mapMethod · 0.95
castFunctionMethod · 0.95

Tested by

no test coverage detected