util.Variant.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of experiment-jvm-server Show documentation
Show all versions of experiment-jvm-server Show documentation
Amplitude Experiment server-side SDK for JVM (Java, Kotlin)
The newest version!
package com.amplitude.experiment.util
import com.amplitude.experiment.Variant
import com.amplitude.experiment.evaluation.EvaluationVariant
internal fun EvaluationVariant.toVariant(): Variant =
Variant(value?.toString(), payload, key, metadata)
internal fun Map.toVariants(): Map =
mapValues { it.value.toVariant() }
internal fun Map.filterDefaultVariants(): Map =
filter { entry ->
val default = entry.value.metadata?.get("default") as? Boolean ?: false
val deployed = entry.value.metadata?.get("deployed") as? Boolean ?: true
(!default && deployed)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy