View on GitHub

Cadabra

A/B testing library for Java/Kotlin/Android

cadabra-core / com.fo2rist.cadabra.resolvers / StaticResolver

StaticResolver

class StaticResolver<V : Variant> : Resolver<V>

Resolver that returns the same variant one constructed. Can be useful when the variant is defined for the lifetime of the app or for testing.

Constructors

<init> Resolver that returns the same variant one constructed. Can be useful when the variant is defined for the lifetime of the app or for testing.StaticResolver(variant: V)

Properties

variant Get variant to be used now. Note that Cadabra calls this method every time variant resolution is required, so if the same variant should be provided for particular user/session/etc. make sure either cache it in the app and don’t ask twice or implement receiver in a way it takes care of that. It’s recommended to keep the app code free from the experiment-related code so caching inside he receiver is preferred.val variant: V