flat_map


Description:

public Optional<A> flat_map<A> (MapFunc<Optional<A>,T> map_func)

Applies the given mapping function if the value is present.

Parameters:

map_func

The mapping function.

Returns:

If the value is present, the mapping function will be applied to the value, and the optional provided by the function will be returned. Otherwise, returns an empty Optional.