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

commonMain.dk.cachet.carp.common.application.Trilean.kt Maven / Gradle / Ivy

Go to download

Helper classes and base types relied upon by all subsystems. This library does not contain any domain logic.

The newest version!
package dk.cachet.carp.common.application

import kotlin.js.JsExport


/**
 * A boolean value that can also be 'unknown' in case insufficient information is available.
 */
@JsExport
enum class Trilean
{
    TRUE,
    FALSE,
    UNKNOWN
}

/**
 * Convert a [Boolean] value into a corresponding [Trilean].
 */
@JsExport
fun Boolean.toTrilean(): Trilean
{
    return if ( this ) Trilean.TRUE else Trilean.FALSE
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy