All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.com.pubnub.api.utils.PatchValue.kt Maven / Gradle / Ivy

Go to download

PubNub is a cross-platform client-to-client (1:1 and 1:many) push service in the cloud, capable of broadcasting real-time messages to millions of web and mobile clients simultaneously, in less than a quarter second!

The newest version!
package com.pubnub.api.utils

import kotlin.jvm.JvmStatic

/**
 * An optional that accepts nullable values. Thus, it can represent two (`PatchValue`) or three (`PatchValue?`) states:
 * * `PatchValue.of(someValue)` - value is present and that value is `someValue`
 * * `PatchValue.of(null)` - value is present and that value is `null`
 * * `null` - lack of information about value (no update for this field)
 */
data class PatchValue internal constructor(val value: T) {
    companion object {
        /**
         * Create an optional with the specified value (which can be null).
         */
        @JvmStatic
        fun  of(value: T): PatchValue = PatchValue(value)
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy