TealiumResult

Result class to support compatibility with Java

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Specifies whether the result was a failure

Link copied to clipboard

Specifies whether the result was successful

Functions

Link copied to clipboard

Gets the exception, if it was a failure, or null if it was successful

Link copied to clipboard
fun getOrNull(): T?

Gets the result, if successful, or null if it was a failure

Link copied to clipboard
fun getOrThrow(): T

Gets the result, if successful, or throws an exception if it was a failure

Link copied to clipboard

Executes the given action when the TealiumResult was a failure.

inline fun onFailure(block: (ex: Throwable) -> Unit): TealiumResult<T>

Executes the given block when the TealiumResult was a failure.

Link copied to clipboard

Executes the given action when the TealiumResult was a success.

inline fun onSuccess(block: (value: T) -> Unit): TealiumResult<T>

Executes the given block when the TealiumResult was a success.