FeatureFlags

Interface for evaluating feature flags.

Functions

Link copied to clipboard
abstract fun get(flag: BooleanFeatureFlag): Boolean

Calculates the value of a boolean feature flag

abstract fun get(flag: DoubleFeatureFlag): Double

Calculates the value of a double feature flag

abstract fun <T : Enum<T>> get(flag: EnumFeatureFlag<T>): T

Calculates the value of an enum feature flag

abstract fun get(flag: IntFeatureFlag): Int

Calculates the value of an int feature flag

abstract fun <T : Any> get(flag: JsonFeatureFlag<T>): T

Calculates the value of a json feature flag

abstract fun get(flag: StringFeatureFlag): String

Calculates the value of a string feature flag

Link copied to clipboard
open fun getBoolean(feature: Feature, key: String): Boolean

abstract fun getBoolean(feature: Feature, key: String, attributes: Attributes = Attributes()): Boolean

Calculates the value of a boolean feature flag for the given key and attributes.

Link copied to clipboard
open fun getDouble(feature: Feature, key: String): Double

abstract fun getDouble(feature: Feature, key: String, attributes: Attributes = Attributes()): Double

Calculates the value of a double feature flag for the given key and attributes.

Link copied to clipboard
open fun <T : Enum<T>> getEnum(feature: Feature, key: String, clazz: Class<T>): T

abstract fun <T : Enum<T>> getEnum(feature: Feature, key: String, clazz: Class<T>, attributes: Attributes = Attributes()): T

Calculates the value of an enumerated feature flag for the given key and attributes.

Link copied to clipboard
inline fun <T : Enum<T>> FeatureFlags.getEnum(feature: Feature, key: String, attributes: Attributes = Attributes()): T
Link copied to clipboard
open fun getInt(feature: Feature, key: String): Int

abstract fun getInt(feature: Feature, key: String, attributes: Attributes = Attributes()): Int

Calculates the value of an integer feature flag for the given key and attributes.

Link copied to clipboard
open fun <T> getJson(feature: Feature, key: String, clazz: Class<T>): T

abstract fun <T> getJson(feature: Feature, key: String, clazz: Class<T>, attributes: Attributes = Attributes()): T

Calculates the value of a JSON feature flag for the given key and attributes.

Link copied to clipboard
inline fun <T> FeatureFlags.getJson(feature: Feature, key: String, attributes: Attributes = Attributes()): T
Link copied to clipboard
open fun getJsonString(feature: Feature, key: String): String

abstract fun getJsonString(feature: Feature, key: String, attributes: Attributes = Attributes()): String

Calculates the value of a JSON feature flag for the given key and attributes and returns it as a json string.

Link copied to clipboard
open fun getString(feature: Feature, key: String): String

abstract fun getString(feature: Feature, key: String, attributes: Attributes = Attributes()): String

Calculates the value of a string feature flag for the given key and attributes.

Link copied to clipboard
open fun trackBoolean(feature: Feature, key: String, executor: Executor, tracker: (Boolean) -> Unit): TrackerReference

abstract fun trackBoolean(feature: Feature, key: String, attributes: Attributes = Attributes(), executor: Executor, tracker: (Boolean) -> Unit): TrackerReference

Registers a tracker for the value of a boolean feature flag for the given key and attributes.

Link copied to clipboard
open fun trackDouble(feature: Feature, key: String, executor: Executor, tracker: (Double) -> Unit): TrackerReference

abstract fun trackDouble(feature: Feature, key: String, attributes: Attributes = Attributes(), executor: Executor, tracker: (Double) -> Unit): TrackerReference

Registers a tracker for the value of a double feature flag for the given key and attributes.

Link copied to clipboard
open fun <T : Enum<T>> trackEnum(feature: Feature, key: String, clazz: Class<T>, executor: Executor, tracker: (T) -> Unit): TrackerReference

abstract fun <T : Enum<T>> trackEnum(feature: Feature, key: String, clazz: Class<T>, attributes: Attributes = Attributes(), executor: Executor, tracker: (T) -> Unit): TrackerReference

Registers a tracker for the value of an enumerated feature flag for the given key and attributes.

Link copied to clipboard
inline fun <T : Enum<T>> FeatureFlags.trackEnum(feature: Feature, key: String, attributes: Attributes = Attributes(), executor: Executor, noinline tracker: (T) -> Unit): TrackerReference
Link copied to clipboard
open fun trackInt(feature: Feature, key: String, executor: Executor, tracker: (Int) -> Unit): TrackerReference

abstract fun trackInt(feature: Feature, key: String, attributes: Attributes = Attributes(), executor: Executor, tracker: (Int) -> Unit): TrackerReference

Registers a tracker for the value of an integer feature flag for the given key and attributes.

Link copied to clipboard
open fun <T> trackJson(feature: Feature, key: String, clazz: Class<T>, executor: Executor, tracker: (T) -> Unit): TrackerReference

abstract fun <T> trackJson(feature: Feature, key: String, clazz: Class<T>, attributes: Attributes = Attributes(), executor: Executor, tracker: (T) -> Unit): TrackerReference

Registers a tracker for the value of a JSON feature flag for the given key and attributes.

Link copied to clipboard
inline fun <T> FeatureFlags.trackJson(feature: Feature, key: String, attributes: Attributes = Attributes(), executor: Executor, noinline tracker: (T) -> Unit): TrackerReference
Link copied to clipboard
open fun trackString(feature: Feature, key: String, executor: Executor, tracker: (String) -> Unit): TrackerReference

abstract fun trackString(feature: Feature, key: String, attributes: Attributes = Attributes(), executor: Executor, tracker: (String) -> Unit): TrackerReference

Registers a tracker for the value of a string feature flag for the given key and attributes.