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

#include "NativeItemList.hpp"  // my header
#include "Marshal.hpp"

namespace djinni_generated {

NativeItemList::NativeItemList() = default;

NativeItemList::~NativeItemList() = default;

auto NativeItemList::fromCpp(JNIEnv* jniEnv, const CppType& c) -> ::djinni::LocalRef<JniType> {
    const auto& data = ::djinni::JniClass<NativeItemList>::get();
    auto r = ::djinni::LocalRef<JniType>{jniEnv->NewObject(data.clazz.get(), data.jconstructor,
                                                           ::djinni::List<::djinni::String>::fromCpp(jniEnv, c.items).get())};
    ::djinni::jniExceptionCheck(jniEnv);
    return r;
}

auto NativeItemList::toCpp(JNIEnv* jniEnv, JniType j) -> CppType {
    ::djinni::JniLocalScope jscope(jniEnv, 2);
    assert(j != nullptr);
    const auto& data = ::djinni::JniClass<NativeItemList>::get();
    return {::djinni::List<::djinni::String>::toCpp(jniEnv, jniEnv->GetObjectField(j, data.field_mItems))};
}

}  // namespace djinni_generated
