Failure

Represents a failure result in a secure local storage operation.

This class is a subtype of SecureLocalStorageResult and is used to encapsulate an error that occurred during the operation. The specific error is provided as an instance of SecureLocalStorageError, which contains details about the failure reason.

Constructors

Link copied to clipboard
constructor(error: SecureLocalStorageError)

Properties

Link copied to clipboard

The specific error that caused the failure.

Link copied to clipboard

Indicates whether the result of the secure local storage operation represents a failure.

Link copied to clipboard

Indicates whether the result represents a successful operation.

Functions

Link copied to clipboard

Returns the exception associated with a failed operation or null if the operation was successful.

Link copied to clipboard

Returns the stored data as a ByteArray if this instance is a successful result and the data can be cast to ByteArray. If the result is unsuccessful or the data cannot be cast, returns null.

Link copied to clipboard
fun getOrNull(): Any?

Retrieves the stored data if the result is a success, or returns null if it is a failure.

Link copied to clipboard

Retrieves the encapsulated data from the result as a String, or returns null if the data is not a String or if the result is a failure.

Link copied to clipboard
inline fun <R> SecureLocalStorageResult.map(transform: (Any?) -> R): Result<R>

Map success value to another type.

Link copied to clipboard

Execute a block if the result is a failure.

Link copied to clipboard

Execute a block if the result is successful.