com.atlan.pkg.serde.cell.EnumXformer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of package-toolkit-runtime Show documentation
Show all versions of package-toolkit-runtime Show documentation
Atlan custom package runtime toolkit
/* SPDX-License-Identifier: Apache-2.0
Copyright 2023 Atlan Pte. Ltd. */
package com.atlan.pkg.serde.cell
import com.atlan.model.enums.AtlanEnum
object EnumXformer {
fun encode(enum: AtlanEnum): String {
return enum.value
}
fun decode(
enum: String,
enumClass: Class,
): AtlanEnum {
val method = enumClass.getMethod("fromValue", String::class.java)
return method.invoke(null, enum) as AtlanEnum
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy