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

#include "NativeNestedCollection.hpp"  // my header
#include "HList.hpp"
#include "HSet.hpp"
#include "HString.hpp"

namespace djinni_generated {

jobject NativeNestedCollection::toJava(JNIEnv* jniEnv, ::NestedCollection c) {
    djinni::LocalRef<jobject> j_set_list(jniEnv, ::djinni::HList<::djinni::HSet<::djinni::HString>>::toJava(jniEnv, c.set_list));
    const auto & data = djinni::JniClass<::djinni_generated::NativeNestedCollection>::get();
    jobject r = jniEnv->NewObject(data.clazz.get(), data.jconstructor, j_set_list.get());
    djinni::jniExceptionCheck(jniEnv);
    return r;
}

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

}  // namespace djinni_generated
