Varioqub

object Varioqub

Main Varioqub class with static methods. If you want to use Varioqub as instance of the class use the getInstance method.

Functions

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

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

Link copied to clipboard

Clears all previously added client features.

Link copied to clipboard

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

Returns a set of all keys for the flags.

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

Returns boolean value from ConfigValue by key. For order of flags see getValue.

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

Returns double value from ConfigValue by key. For order of flags see getValue.

Link copied to clipboard

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

Link copied to clipboard

Returns instance of Varioqub.

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

Returns long value from ConfigValue by key. For order of flags see getValue.

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

Returns string value from ConfigValue by key. For order of flags see getValue.

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

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

Link copied to clipboard

Adds or replaces client feature used for experiment filtering.

Link copied to clipboard

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

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: