Package-level declarations

This package contains interfaces and classes used across the SDK.

Types

Link copied to clipboard
typealias Bundle = android.os.Bundle

Implementation of Bundle for Android - a type alias to android.os.Bundle.

Link copied to clipboard
interface Callback<T, U>

Generic callback interface with a generic return types.

Link copied to clipboard
@RestrictToExtendedFlavor(value = [ExternalScope.LIBRARY_GROUP])
interface CallbackExecutor

Generic contract for an executor of Runnable callbacks.

Link copied to clipboard
fun interface Cancellable

Represents a cancellable operation.

Link copied to clipboard
typealias Parcel = android.os.Parcel

Implementation of Parcel for Android - a type alias to android.os.Parcel.

Link copied to clipboard
typealias Parcelable = android.os.Parcelable

Implementation of Parcelable for Android - a type alias to android.os.Parcelable.

Link copied to clipboard
sealed class Result<out SuccessType, out FailureType>

Class that represents either the Success outcome with a value of type SuccessType or Failure with a value of type FailureType.

Link copied to clipboard
@RestrictToExtendedFlavor(value = [ExternalScope.LIBRARY_GROUP])
class TaskHandler

The implementation of the TaskHandler class for the Android platform. It uses the Android Handler and Looper to execute tasks asynchronously on the main thread.

Link copied to clipboard
value class UniqueId(val value: Long = nextValue.incrementAndGet())

Thread safe, single process 64 bit unique id. Not to be used if unique multi-process id generation is required.

Link copied to clipboard
typealias Uri = android.net.Uri

Implementation of Uri for Android.

Functions

Link copied to clipboard
inline fun <V, F, V2, F2> Result<V, F>.bimap(successMapper: (V) -> V2, failureMapper: (F) -> F2): Result<V2, F2>

Maps success value or failure.

Link copied to clipboard
inline fun <V, F, V2> Result<V, F>.flatMap(mapper: (V) -> Result<V2, F>): Result<V2, F>

Maps success value to a new Result or passes failure.

Link copied to clipboard
inline fun <V, F, R> Result<V, F>.fold(ifSuccess: (V) -> R, ifFailure: (F) -> R): R

Folds success or failure into a final value.

Link copied to clipboard
inline fun <V, F> Result<V, F>.ifFailure(ifFailure: (F) -> Unit): Result<V, F>

Performs provided operation if Result is failure.

Link copied to clipboard
inline fun <V, F> Result<V, F>.ifSuccess(ifSuccess: (V) -> Unit): Result<V, F>

Performs provided operation if Result is success.

Link copied to clipboard
inline fun <V, F, V2> Result<V, F>.map(mapper: (V) -> V2): Result<V2, F>

Maps success value or passes failure.

Link copied to clipboard
inline fun <V, F, F2> Result<V, F>.mapFailure(mapper: (F) -> F2): Result<V, F2>

Maps failure or passes success value.

Link copied to clipboard
inline fun <V, F> Result<V, F>.valueOr(handler: (F) -> V): V

Returns success value or uses handler to map failure to value.