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

#include "NativeItemList.hpp"  // my header
#include "HList.hpp"
#include "HString.hpp"

namespace djinni_generated {

jobject NativeItemList::toJava(JNIEnv* jniEnv, ::textsort::ItemList c) {
    djinni::LocalRef<jobject> j_items(jniEnv, ::djinni::HList<::djinni::HString>::toJava(jniEnv, c.items));
    const auto & data = djinni::JniClass<::djinni_generated::NativeItemList>::get();
    jobject r = jniEnv->NewObject(data.clazz.get(), data.jconstructor, j_items.get());
    djinni::jniExceptionCheck(jniEnv);
    return r;
}

::textsort::ItemList NativeItemList::fromJava(JNIEnv* jniEnv, jobject j) {
    assert(j != nullptr);
    const auto & data = djinni::JniClass<::djinni_generated::NativeItemList>::get();
    return ::textsort::ItemList(
        ::djinni::HList<::djinni::HString>::fromJava(jniEnv, djinni::LocalRef<jobject>(jniEnv, jniEnv->GetObjectField(j, data.field_mItems)).get()));
}

}  // namespace djinni_generated
