Package-level declarations

Types

Link copied to clipboard
class POFailure

Defines error codes structure.

Link copied to clipboard

Parcelable unit object. Represents the absence of meaningful value.

Link copied to clipboard

Provides Success or Failure as a result of operation received from Activity.

Link copied to clipboard
interface ProcessOutCallback<in T : Any>

Provides onSuccess or onFailure callbacks as a result of operation.

Link copied to clipboard
sealed class ProcessOutResult<out T : Any>

Provides Success or Failure as a result of operation.

Properties

Link copied to clipboard

Raw error code. Consistent with iOS SDK.

Functions

Link copied to clipboard

Returns the unmodified copy of the result.

Link copied to clipboard
inline fun <T : Parcelable, R> ProcessOutActivityResult<T>.fold(onSuccess: (value: T) -> R, onFailure: (failure: ProcessOutActivityResult.Failure) -> R): R

Returns the result of onSuccess for the encapsulated value if this instance represents Success or the result of onFailure for the encapsulated failure if it is Failure.

inline fun <T : Any, R> ProcessOutResult<T>.fold(onSuccess: (value: T) -> R, onFailure: (failure: ProcessOutResult.Failure) -> R): R

Returns the result of onSuccess for the encapsulated value if this instance represents Success or the result of onFailure for the encapsulated failure if it is Failure.

Link copied to clipboard

Returns the encapsulated value if this instance represents Success or null if it is Failure.

Returns the encapsulated value if this instance represents Success or null if it is Failure.

Link copied to clipboard
inline fun <T : Any> ProcessOutResult<T>.handleFailure(block: (code: POFailure.Code, message: String?, invalidFields: List<POFailure.InvalidField>?, cause: Exception?) -> Unit)
Link copied to clipboard
inline fun <T : Any> ProcessOutResult<T>.handleSuccess(block: (value: T) -> Unit)
Link copied to clipboard
inline fun <T : Any, R : Any> ProcessOutResult<T>.map(transform: (T) -> R): ProcessOutResult<R>

Returns the encapsulated result of the given transform function applied to the encapsulated value if this instance represents Success or the Failure otherwise.

Link copied to clipboard

Performs the given action on the encapsulated failure if this instance represents Failure. Returns the original ProcessOutActivityResult unchanged.

Performs the given action on the encapsulated failure if this instance represents Failure. Returns the original ProcessOutResult unchanged.

Link copied to clipboard

Performs the given action on the encapsulated value if this instance represents Success. Returns the original ProcessOutActivityResult unchanged.

inline fun <T : Any> ProcessOutResult<T>.onSuccess(action: (value: T) -> Unit): ProcessOutResult<T>

Performs the given action on the encapsulated value if this instance represents Success. Returns the original ProcessOutResult unchanged.