///
/// JBatteryPowerModeEvent.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 "BatteryPowerModeEvent.hpp"



namespace margelo::nitro::one {

  using namespace facebook;

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

  public:
    /**
     * Convert this Java/Kotlin-based struct to the C++ struct BatteryPowerModeEvent by copying all values to C++.
     */
    [[maybe_unused]]
    [[nodiscard]]
    BatteryPowerModeEvent toCpp() const {
      static const auto clazz = javaClassStatic();
      static const auto fieldLowPowerMode = clazz->getField<jboolean>("lowPowerMode");
      jboolean lowPowerMode = this->getFieldValue(fieldLowPowerMode);
      return BatteryPowerModeEvent(
        static_cast<bool>(lowPowerMode)
      );
    }

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

} // namespace margelo::nitro::one
