LocalzResult

sealed class LocalzResult<out T>

A sealed class representing the result of an operation that may either succeed or fail.

This class is used throughout the Localz SDK to provide a consistent way to handle operation results while maintaining type safety. Operations return either a Success containing the expected result data, or an Error with information about what went wrong.

Parameters

T

The type of data that will be returned in case of success.

Inheritors

Constructors

Link copied to clipboard
protected constructor()

Types

Link copied to clipboard
object Companion
Link copied to clipboard
data class Error<out T>(val message: String, val throwable: Throwable? = null, val statusCode: Int = 0) : LocalzResult<T>

Represents a failed operation with error details.

Link copied to clipboard
data class Success<out T>(val payload: T) : LocalzResult<T>

Represents a successful operation with associated payload data.

Functions

Link copied to clipboard

Maps a result of any type to a result with a Unit payload, preserving success/error status.