T
- the value typepublic interface FuseToMaybe<T>
Single<Integer> single = Maybe.just(1).isEmpty(); Maybe<Integer> maybe = single.toMaybe();The
Single.toMaybe()
will check for this interface and call the fuseToMaybe()
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.
Modifier and Type | Method and Description |
---|---|
Maybe<T> |
fuseToMaybe()
Returns a (direct) Maybe for the operator.
|
Copyright © 2018 JBoss by Red Hat. All rights reserved.