commonMain.org.jellyfin.sdk.model.extensions.GeneralCommandMessageExtensions.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jellyfin-model-jvm Show documentation
Show all versions of jellyfin-model-jvm Show documentation
Official Kotlin/Java SDK for Jellyfin. org.jellyfin.sdk:jellyfin-model-jvm
package org.jellyfin.sdk.model.extensions
import org.jellyfin.sdk.model.api.GeneralCommandMessage
import kotlin.reflect.KProperty
// Single get
public operator fun GeneralCommandMessage.get(name: String): String? =
data?.arguments?.entries?.firstOrNull { (key) ->
key.contentEquals(name, ignoreCase = true)
}?.value
// Multi get
public operator fun GeneralCommandMessage.get(vararg names: String): List =
names.map(::get)
// Property delegation
public operator fun GeneralCommandMessage.getValue(thisRef: Any?, property: KProperty<*>): String? =
get(property.name)
// Value checking
public operator fun GeneralCommandMessage.contains(name: String): Boolean =
data?.arguments?.any { (key) ->
key.contentEquals(name, ignoreCase = true)
} ?: false
© 2015 - 2025 Weber Informatics LLC | Privacy Policy