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

#include "NativeOptColorRecord.hpp"  // my header
#include "Marshal.hpp"
#include "NativeColor.hpp"

namespace djinni_generated {

NativeOptColorRecord::NativeOptColorRecord() = default;

NativeOptColorRecord::~NativeOptColorRecord() = default;

auto NativeOptColorRecord::fromCpp(JNIEnv* jniEnv, const CppType& c) -> ::djinni::LocalRef<JniType> {
    const auto& data = ::djinni::JniClass<NativeOptColorRecord>::get();
    auto r = ::djinni::LocalRef<JniType>{jniEnv->NewObject(data.clazz.get(), data.jconstructor,
                                                           ::djinni::get(::djinni::Optional<std::experimental::optional, ::djinni_generated::NativeColor>::fromCpp(jniEnv, c.my_color)))};
    ::djinni::jniExceptionCheck(jniEnv);
    return r;
}

auto NativeOptColorRecord::toCpp(JNIEnv* jniEnv, JniType j) -> CppType {
    ::djinni::JniLocalScope jscope(jniEnv, 2);
    assert(j != nullptr);
    const auto& data = ::djinni::JniClass<NativeOptColorRecord>::get();
    return {::djinni::Optional<std::experimental::optional, ::djinni_generated::NativeColor>::toCpp(jniEnv, jniEnv->GetObjectField(j, data.field_mMyColor))};
}

}  // namespace djinni_generated
