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

#include "NativeClientReturnedRecord.hpp"  // my header
#include "HI64.hpp"
#include "HString.hpp"

namespace djinni_generated {

jobject NativeClientReturnedRecord::toJava(JNIEnv* jniEnv, ClientReturnedRecord c) {
    jlong j_record_id = ::djinni::HI64::Unboxed::toJava(jniEnv, c.record_id);
    djinni::LocalRef<jstring> j_content(jniEnv, ::djinni::HString::toJava(jniEnv, c.content));
    const auto & data = djinni::JniClass<::djinni_generated::NativeClientReturnedRecord>::get();
    jobject r = jniEnv->NewObject(data.clazz.get(), data.jconstructor, j_record_id, j_content.get());
    djinni::jniExceptionCheck(jniEnv);
    return r;
}

ClientReturnedRecord NativeClientReturnedRecord::fromJava(JNIEnv* jniEnv, jobject j) {
    assert(j != nullptr);
    const auto & data = djinni::JniClass<::djinni_generated::NativeClientReturnedRecord>::get();
    return ClientReturnedRecord(
        ::djinni::HI64::Unboxed::fromJava(jniEnv, jniEnv->GetLongField(j, data.field_mRecordId)),
        ::djinni::HString::fromJava(jniEnv, djinni::LocalRef<jstring>(jniEnv, static_cast<jstring>(jniEnv->GetObjectField(j, data.field_mContent))).get()));
}

}  // namespace djinni_generated
