ObjectExt<T extends Object> extension

Extension for Objects.

on
  • T

Methods

apply<R>(R f(T self)) → R
Applies f to this object and returns the result.
when(bool predicate(T self), {T? orElse(T self)?}) → T?
Returns the result of orElse if predicate returns false, otherwise returns this.