fix: changed Any to kotlin.Any (#10985)

This commit is contained in:
Alexander Karkossa
2021-11-29 17:42:22 +01:00
committed by GitHub
parent 3b5345eb57
commit 8e2e200e18
2 changed files with 4 additions and 4 deletions

View File

@@ -67,12 +67,12 @@ import kotlinx.serialization.*
/**
* Converts the provided [data] to a [String] on success, null otherwise.
*/
fun encode(data: Any?): kotlin.String? = if (data is {{classname}}) "$data" else null
fun encode(data: kotlin.Any?): kotlin.String? = if (data is {{classname}}) "$data" else null
/**
* Returns a valid [{{classname}}] for [data], null otherwise.
*/
fun decode(data: Any?): {{classname}}? = data?.let {
fun decode(data: kotlin.Any?): {{classname}}? = data?.let {
val normalizedData = "$it".lowercase()
values().firstOrNull { value ->
it == value || normalizedData == "$value".lowercase()

View File

@@ -50,12 +50,12 @@ enum class PetEnum(val value: kotlin.String) {
/**
* Converts the provided [data] to a [String] on success, null otherwise.
*/
fun encode(data: Any?): kotlin.String? = if (data is PetEnum) "$data" else null
fun encode(data: kotlin.Any?): kotlin.String? = if (data is PetEnum) "$data" else null
/**
* Returns a valid [PetEnum] for [data], null otherwise.
*/
fun decode(data: Any?): PetEnum? = data?.let {
fun decode(data: kotlin.Any?): PetEnum? = data?.let {
val normalizedData = "$it".lowercase()
values().firstOrNull { value ->
it == value || normalizedData == "$value".lowercase()