getOrDefault

fun getOrDefault(defaultValue: T): T

Returns the data if this is a Success response, or the provided default value otherwise.

Return

The data if successful, defaultValue otherwise.

Parameters

defaultValue

The value to return if this response is not a Success.