OrElseGet<T> extension

Extension on T? to add an orElseGet method.

on
  • T?

Methods

orElseGet(T supplier()) → T

Available on T?, provided by the OrElseGet extension

Returns the value if it is not null, otherwise returns the value supplied by the supplier function.