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

dk.nodes.nstack.kotlin.models.AppUpdate.kt Maven / Gradle / Ivy

There is a newer version: 3.3.0
Show newest version
package dk.nodes.nstack.kotlin.models

data class AppUpdate(
    internal val newerVersion: Update? = null,
    internal val newInVersion: Update? = null
)

val AppUpdate.update: Update?
    get() {
        return newerVersion ?: newInVersion
    }

val AppUpdate.state: AppUpdateState
    get() {
        return when {
            update?.state == "yes" -> AppUpdateState.UPDATE
            update?.state == "force" -> AppUpdateState.FORCE
            newInVersion != null -> AppUpdateState.CHANGELOG
            else -> AppUpdateState.NONE
        }
    }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy