Success

data class Success<T>(val result: T) : AdResult<T>

Represents a successful result.

Parameters

result

The result of the executed operation.

Constructors

Link copied to clipboard
constructor(result: T)

Properties

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.

Link copied to clipboard
val result: T

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.