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

com.atlan.pkg.serde.cell.EnumXformer.kt Maven / Gradle / Ivy

There is a newer version: 3.1.2
Show newest version
/* 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