// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from map.djinni

#include "NativeMapRecord.hpp"  // my header
#include "HI64.hpp"
#include "HMap.hpp"
#include "HString.hpp"

namespace djinni_generated {

jobject NativeMapRecord::toJava(JNIEnv* jniEnv, ::MapRecord c) {
    djinni::LocalRef<jobject> j_map(jniEnv, ::djinni::HMap<::djinni::HString, ::djinni::HI64>::toJava(jniEnv, c.map));
    const auto & data = djinni::JniClass<::djinni_generated::NativeMapRecord>::get();
    jobject r = jniEnv->NewObject(data.clazz.get(), data.jconstructor, j_map.get());
    djinni::jniExceptionCheck(jniEnv);
    return r;
}

::MapRecord NativeMapRecord::fromJava(JNIEnv* jniEnv, jobject j) {
    assert(j != nullptr);
    const auto & data = djinni::JniClass<::djinni_generated::NativeMapRecord>::get();
    return ::MapRecord(
        ::djinni::HMap<::djinni::HString, ::djinni::HI64>::fromJava(jniEnv, djinni::LocalRef<jobject>(jniEnv, jniEnv->GetObjectField(j, data.field_mMap)).get()));
}

}  // namespace djinni_generated
