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

#pragma once

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



namespace margelo::nitro::stylesheet {

  using namespace facebook;

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

  public:
    /**
     * Convert this Java/Kotlin-based struct to the C++ struct ScreenInsets by copying all values to C++.
     */
    [[maybe_unused]]
    ScreenInsets toCpp() const {
      static const auto clazz = javaClassStatic();
      static const auto fieldTop = clazz->getField<double>("top");
      double top = this->getFieldValue(fieldTop);
      static const auto fieldLeft = clazz->getField<double>("left");
      double left = this->getFieldValue(fieldLeft);
      static const auto fieldBottom = clazz->getField<double>("bottom");
      double bottom = this->getFieldValue(fieldBottom);
      static const auto fieldRight = clazz->getField<double>("right");
      double right = this->getFieldValue(fieldRight);
      return ScreenInsets(
        top,
        left,
        bottom,
        right
      );
    }

  public:
    /**
     * Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
     */
    [[maybe_unused]]
    static jni::local_ref<JScreenInsets::javaobject> fromCpp(const ScreenInsets& value) {
      return newInstance(
        value.top,
        value.left,
        value.bottom,
        value.right
      );
    }
  };

} // namespace margelo::nitro::stylesheet
