All Downloads are FREE. Search and download functionalities are using the official Maven repository.

.experiment-jvm-server.1.1.0-beta.1.source-code.Variant.kt Maven / Gradle / Ivy

package com.amplitude.experiment

data class Variant @JvmOverloads constructor(
    @JvmField val value: String? = null,
    @JvmField val payload: Any? = null,
) {
    companion object {
        /**
         * Utility function for comparing a possibly null variant's value to a string in java.
         *
         * ```
         * Variant.valueEquals(variant, "on");
         * ```
         *
         * is equivalent to
         *
         * ```
         * variant != null && "on".equals(variant.value)
         * ```
         *
         * @param variant The nullable variant whose value should be compared.
         * @param value The string to compare with the value of the variant.
         */
        @JvmStatic
        fun valueEquals(variant: Variant?, value: String?) = variant?.value == value
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy