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

#include "NativeDateRecord.hpp"  // my header
#include "HDate.hpp"

namespace djinni_generated {

jobject NativeDateRecord::toJava(JNIEnv* jniEnv, ::DateRecord c) {
    djinni::LocalRef<jobject> j_created_at(jniEnv, ::djinni::HDate::toJava(jniEnv, c.created_at));
    const auto & data = djinni::JniClass<::djinni_generated::NativeDateRecord>::get();
    jobject r = jniEnv->NewObject(data.clazz.get(), data.jconstructor, j_created_at.get());
    djinni::jniExceptionCheck(jniEnv);
    return r;
}

::DateRecord NativeDateRecord::fromJava(JNIEnv* jniEnv, jobject j) {
    assert(j != nullptr);
    const auto & data = djinni::JniClass<::djinni_generated::NativeDateRecord>::get();
    return ::DateRecord(
        ::djinni::HDate::fromJava(jniEnv, djinni::LocalRef<jobject>(jniEnv, jniEnv->GetObjectField(j, data.field_mCreatedAt)).get()));
}

}  // namespace djinni_generated
