flatMap

inline fun <E : Any, T : Any> Optional<E>.flatMap(mapper: (E) -> Optional<T>): Optional<T>(source)

Applies the mapper to the optional if it is a Value, returns the same optional otherwise.