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)
| 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. |
no test coverage detected