///
/// JNotificationBehavior.hpp
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
/// https://github.com/mrousavy/nitro
/// Copyright © Marc Rousavy @ Margelo
///

#pragma once

#include <fbjni/fbjni.h>
#include "NotificationBehavior.hpp"



namespace margelo::nitro::one {

  using namespace facebook;

  /**
   * The C++ JNI bridge between the C++ struct "NotificationBehavior" and the Kotlin data class "NotificationBehavior".
   */
  struct JNotificationBehavior final: public jni::JavaClass<JNotificationBehavior> {
  public:
    static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/one/NotificationBehavior;";

  public:
    /**
     * Convert this Java/Kotlin-based struct to the C++ struct NotificationBehavior by copying all values to C++.
     */
    [[maybe_unused]]
    [[nodiscard]]
    NotificationBehavior toCpp() const {
      static const auto clazz = javaClassStatic();
      static const auto fieldShouldShowBanner = clazz->getField<jboolean>("shouldShowBanner");
      jboolean shouldShowBanner = this->getFieldValue(fieldShouldShowBanner);
      static const auto fieldShouldShowList = clazz->getField<jboolean>("shouldShowList");
      jboolean shouldShowList = this->getFieldValue(fieldShouldShowList);
      static const auto fieldShouldPlaySound = clazz->getField<jboolean>("shouldPlaySound");
      jboolean shouldPlaySound = this->getFieldValue(fieldShouldPlaySound);
      static const auto fieldShouldSetBadge = clazz->getField<jboolean>("shouldSetBadge");
      jboolean shouldSetBadge = this->getFieldValue(fieldShouldSetBadge);
      return NotificationBehavior(
        static_cast<bool>(shouldShowBanner),
        static_cast<bool>(shouldShowList),
        static_cast<bool>(shouldPlaySound),
        static_cast<bool>(shouldSetBadge)
      );
    }

  public:
    /**
     * Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
     */
    [[maybe_unused]]
    static jni::local_ref<JNotificationBehavior::javaobject> fromCpp(const NotificationBehavior& value) {
      using JSignature = JNotificationBehavior(jboolean, jboolean, jboolean, jboolean);
      static const auto clazz = javaClassStatic();
      static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
      return create(
        clazz,
        value.shouldShowBanner,
        value.shouldShowList,
        value.shouldPlaySound,
        value.shouldSetBadge
      );
    }
  };

} // namespace margelo::nitro::one
