Client

abstract class Client<T> : Config

Constructors

Link copied to clipboard
fun Client(apiToken: String, url: String, path: String, liveUpdates: Boolean)

Functions

Link copied to clipboard
abstract fun all(): Map<String, Boolean>

Returns all flag evaluations.

Link copied to clipboard
open fun initialize(onInitialized: () -> Unit? = null)

Asynchronously initializes the client by loading cached data and connecting with the server.

Link copied to clipboard
fun isEnabled(name: String): Boolean

Returns true if flag named name exists and evaluates to true, false otherwise.

abstract fun isEnabled(name: String, default: Boolean): Boolean

Returns true if flag named name evaluates to true, false if it evaluates to false, and default if it does not exist or is archived.

Link copied to clipboard
open override fun putBoolean(key: String, value: Boolean): Config
Link copied to clipboard
open override fun putListBoolean(key: String, values: List<Boolean>): Config
Link copied to clipboard
open override fun putListNumber(key: String, values: List<Number>): Config
Link copied to clipboard
open override fun putListString(key: String, values: List<String>): Config
Link copied to clipboard
open override fun putNumber(key: String, value: Number): Config
Link copied to clipboard
open override fun putString(key: String, value: String): Config
Link copied to clipboard
open override fun setDeviceLocale(locale: String): Config
Link copied to clipboard
open override fun setDeviceName(name: String): Config
Link copied to clipboard
open override fun setDeviceOs(os: String): Config
Link copied to clipboard
open override fun setRolloutId(rolloutId: String): Config
Link copied to clipboard
open override fun setUserEmail(email: String): Config
Link copied to clipboard
open override fun setUserId(id: String): Config
Link copied to clipboard
open fun shutdown()

Shuts down the client, freeing associated resources.

Properties

Link copied to clipboard
open override val apiToken: String
Link copied to clipboard
open override val env: JsonObject
Link copied to clipboard
open override val liveUpdates: Boolean
Link copied to clipboard
open override val url: String

Extensions

Link copied to clipboard
fun Client<*>.initializeInternal(engine: HttpClientEngine?): Job

Sources

Link copied to clipboard