Interface FuseToMaybe<T>
-
- Type Parameters:
T- the value type
- All Known Implementing Classes:
MaybeIgnoreElementCompletable,MaybeIsEmptySingle
public interface FuseToMaybe<@NonNull T>Interface indicating an operator implementation can be macro-fused back to Maybe in case the operator goes from Maybe to some other reactive type and then the sequence calls for toMaybe again:
TheSingle<Integer> single = Maybe.just(1).isEmpty(); Maybe<Integer> maybe = single.toMaybe();Single.toMaybe()will check for this interface and call thefuseToMaybe()to return a Maybe which could be the Maybe-specific implementation of isEmpty().This causes a slight overhead in assembly time (1 instanceof check, 1 operator allocation and 1 dropped operator) but does not incur the conversion overhead at runtime.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description @NonNull Maybe<T>fuseToMaybe()Returns a (direct) Maybe for the operator.
-