io.paymenthighway.sdk.util / Result / Success

Success

data class Success<out V> : Result<V, Nothing>

Operation was successful and return a associated value of type V

Parameters

value - associated to the sucessful operation

Constructors

<init>

Success(value: V)

Operation was successful and return a associated value of type V

Properties

value

val value: V

associated to the sucessful operation

Inherited Properties

isError

val isError: Boolean

Returns true if the result is a failure

isSuccess

val isSuccess: Boolean

Returns true if the result is a success

Inherited Functions

getErrorOrNull

fun getErrorOrNull(): E?

Returns the associated exception error of type E if operation encountered a failure, otherwise null

getOrThrow

fun getOrThrow(): V

Returns the associated value of type V if operation was successful, otherwise throws the failure exception

getValueOrNull

fun getValueOrNull(): V?

Returns the associated value of type V if operation was successful, otherwise null