Error

data class Error<T>(val error: AdError) : AdResult<T>

Represents a failed result.

Parameters

error

The AdError that occurred during the execution of the operation.

Constructors

Link copied to clipboard
constructor(error: AdError)

Properties

Link copied to clipboard
Link copied to clipboard

Boolean flag to determine whether the result is failure.

Link copied to clipboard

Boolean flag to determine whether the result is successful.

Functions

Link copied to clipboard

A method to get the AdError if the operation is completed with an error, or null if the operation is completed successfully.

Link copied to clipboard
fun get(onSuccess: (T) -> Unit, onError: (AdError) -> Unit = {})

The main method for parsing the result.

Link copied to clipboard
fun getOrNull(): T?

A method to get the result of the operation if the operation is completed successfully, or null if an error occurs.