orElseGet

open fun orElseGet(block: (E) -> T): T

Returns the result value in case of Success, otherwise returns the result of the block of code.

Return

The result value in case of Success, otherwise the result of block.

Parameters

block

The block to execute.