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

com.loudsight.utilities.KlassHelper Maven / Gradle / Ivy

The newest version!
package com.loudsight.utilities;

import kotlin.reflect.KClass;
import org.jetbrains.annotations.NotNull;

public class KlassHelper {

    public static  KClass toKClass(@NotNull Object obj) {
        if (obj instanceof KClass) {
            return Cast.INSTANCE.uncheckedCast(obj);
        } else if (obj instanceof Class) {
            return kotlin.jvm.JvmClassMappingKt.getKotlinClass(
                    Cast.INSTANCE.uncheckedCast(obj)
            );
        }
        throw new RuntimeException("Unexpected type");
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy