Remove XmlAttribute PairExtensions

The XmlAttribute is removed in 10.9
This commit is contained in:
Niels van Velzen 2024-03-25 18:54:00 +01:00 committed by Niels van Velzen
parent 218e4689c1
commit 9ba366eaea
2 changed files with 0 additions and 31 deletions

View File

@ -4,7 +4,6 @@ import org.jellyfin.sdk.model.UUID
import org.jellyfin.sdk.model.api.NameGuidPair
import org.jellyfin.sdk.model.api.NameIdPair
import org.jellyfin.sdk.model.api.NameValuePair
import org.jellyfin.sdk.model.api.XmlAttribute
/**
* Convert a [NameIdPair] to a [Pair] with [NameIdPair.id] as [Pair.first] and [NameIdPair.name] as [Pair.second].
@ -39,16 +38,3 @@ public fun NameValuePair.toPair(): Pair<String?, String?> = name to value
* [NameValuePair.value].
*/
public fun Pair<String?, String?>.toNameValuePair(): NameValuePair = NameValuePair(name = first, value = second)
/**
* Convert a [XmlAttribute] to a [Pair] with [XmlAttribute.name] as [Pair.first] and [XmlAttribute.value] as
* [Pair.second].
*/
public fun XmlAttribute.toPair(): Pair<String?, String?> = name to value
/**
* Convert a [Pair] to a [XmlAttribute] with [Pair.first] as [XmlAttribute.name] and [Pair.second] as
* [XmlAttribute.value].
*/
public fun Pair<String?, String?>.toXmlAttribute(): XmlAttribute = XmlAttribute(name = first, value = second)

View File

@ -4,7 +4,6 @@ import io.kotest.core.spec.style.FunSpec
import io.kotest.matchers.shouldBe
import org.jellyfin.sdk.model.api.NameIdPair
import org.jellyfin.sdk.model.api.NameValuePair
import org.jellyfin.sdk.model.api.XmlAttribute
class PairExtensionTests : FunSpec({
test("NameIdPair to Pair") {
@ -38,20 +37,4 @@ class PairExtensionTests : FunSpec({
Pair(null, null).toNameValuePair() shouldBe NameValuePair(name = null, value = null)
Pair("name", "value").toNameValuePair() shouldBe NameValuePair("name", "value")
}
test("XmlAttribute to Pair") {
XmlAttribute(name = "name", value = "value").toPair() shouldBe Pair("name", "value")
XmlAttribute(name = "name", value = null).toPair() shouldBe Pair("name", null)
XmlAttribute(name = null, value = "value").toPair() shouldBe Pair(null, "value")
XmlAttribute(name = null, value = null).toPair() shouldBe Pair(null, null)
XmlAttribute("name", "value").toPair() shouldBe Pair("name", "value")
}
test("Pair to XmlAttribute") {
Pair("name", "value").toXmlAttribute() shouldBe XmlAttribute(name = "name", value = "value")
Pair("name", null).toXmlAttribute() shouldBe XmlAttribute(name = "name", value = null)
Pair(null, "value").toXmlAttribute() shouldBe XmlAttribute(name = null, value = "value")
Pair(null, null).toXmlAttribute() shouldBe XmlAttribute(name = null, value = null)
Pair("name", "value").toXmlAttribute() shouldBe XmlAttribute("name", "value")
}
})