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

#include "NativePrimitiveList.hpp"  // my header
#include "HI64.hpp"
#include "HList.hpp"

namespace djinni_generated {

jobject NativePrimitiveList::toJava(JNIEnv* jniEnv, PrimitiveList c) {
    djinni::LocalRef<jobject> j_list(jniEnv, ::djinni::HList<::djinni::HI64>::toJava(jniEnv, c.list));
    const auto & data = djinni::JniClass<::djinni_generated::NativePrimitiveList>::get();
    jobject r = jniEnv->NewObject(data.clazz.get(), data.jconstructor, j_list.get());
    djinni::jniExceptionCheck(jniEnv);
    return r;
}

PrimitiveList NativePrimitiveList::fromJava(JNIEnv* jniEnv, jobject j) {
    assert(j != nullptr);
    const auto & data = djinni::JniClass<::djinni_generated::NativePrimitiveList>::get();
    return PrimitiveList(
        ::djinni::HList<::djinni::HI64>::fromJava(jniEnv, djinni::LocalRef<jobject>(jniEnv, jniEnv->GetObjectField(j, data.field_mList)).get()));
}

}  // namespace djinni_generated
