VarioqubApi

interface VarioqubApi

Main varioqub interface

Functions

Link copied to clipboard
abstract fun activateConfig(onComplete: () -> Unit? = null)

Activates last fetched config. Calls onComplete listener when activation successfully ends.

Link copied to clipboard
abstract fun clearClientFeatures()

Clears all previously added client features.

Link copied to clipboard
abstract fun fetchConfig(listener: OnFetchCompleteListener?)

Fetches flags from server. After successful fetch, call OnFetchCompleteListener.onSuccess. If error occurs while fetch, OnFetchCompleteListener.onError will be called with a message and the FetchError reason.

Link copied to clipboard
abstract fun getAllKeys(): Set<String>

Returns a set of all keys for the flags.

Link copied to clipboard
abstract fun getBoolean(key: String, default: Boolean = false): Boolean

Returns boolean value from ConfigValue by key.

Link copied to clipboard
abstract fun getDouble(key: String, default: Double = 0.0): Double

Returns double value from ConfigValue by key.

Link copied to clipboard
abstract fun getId(): String

Returns the identifier of the last fetched experiment. Used for debug purposes.

Link copied to clipboard
abstract fun getLong(key: String, default: Long = 0): Long

Returns long value from ConfigValue by key.

Link copied to clipboard
abstract fun getString(key: String, default: String = ""): String

Returns string value from ConfigValue by key.

Link copied to clipboard
abstract fun getValue(key: String): ConfigValue?

Returns ConfigValue

Link copied to clipboard
abstract fun init(settings: VarioqubSettings, adapter: VarioqubConfigAdapter, context: Context)

Initializes Varioqub with settings, adapter for analytic system, and Android Context.

Link copied to clipboard
abstract fun putClientFeature(key: String, value: String)

Adds or replaces client feature used for experiment filtering.

Link copied to clipboard
abstract fun setDefaults(defaults: Map<String, Any>)

Sets map with default values. Map will be overwritten each time this method is called.

abstract fun setDefaults(@XmlRes resId: Int, onComplete: () -> Unit? = null)

Sets defaults by XML resource with ID. Calls the onComplete listener when defaults are saved. XML format: