kotlin

//pubnub-core-api/com.pubnub.api.v2.callbacks

Package-level declarations

Types

Name Summary
BaseEventEmitter [jvm]
interface BaseEventEmitter<T : Listener>
BaseEventListener [jvm]
interface BaseEventListener : Listener
BaseStatusEmitter [jvm]
interface BaseStatusEmitter<T : BaseStatusListener>
BaseStatusListener [jvm]
interface BaseStatusListener : Listener
Result [jvm]
class Result<out T>
A discriminated union that encapsulates a successful outcome with a value of type T or a failure with a PubNubException.

Functions

Name Summary
getOrDefault [jvm]
inline fun <R, T : R> Result<T>.getOrDefault(defaultValue: R): R
Returns the encapsulated value if this instance represents success or the defaultValue if it is failure.
getOrElse [jvm]
inline fun <R, T : R> Result<T>.getOrElse(onFailure: (exception: PubNubException) -> R): R
Returns the encapsulated value if this instance represents success or the result of onFailure function for the encapsulated PubNubException exception if it is failure.
getOrThrow [jvm]
fun <T> Result<T>.getOrThrow(): T
Returns the encapsulated value if this instance represents success or throws the encapsulated PubNubException if it is failure.