HigherOrderFunctions<T> extension

on
  • T?

Methods

flatMap<U>(U? f(T)) → U?

Available on T?, provided by the HigherOrderFunctions extension

Applies a transformation f that may return null to the value if it is not null.
inspect(void f(T)) → T?

Available on T?, provided by the HigherOrderFunctions extension

Calls the provided closure with a reference to the value if it is not null and returns the value.
map<U>(U f(T)) → U?

Available on T?, provided by the HigherOrderFunctions extension

Applies a transformation f to the value if it is not null.
mapIf<U>(bool p(T), U f(T)) → U?

Available on T?, provided by the HigherOrderFunctions extension

Maps over the value if it is not null and satisfies the given predicate.
or(T alt) → T

Available on T?, provided by the HigherOrderFunctions extension

Returns the value if it's not a null, otherwise returns the alternative alt.
orElse(T f()) → T

Available on T?, provided by the HigherOrderFunctions extension

Returns the value if it's not a null, otherwise calls f and returns the result.