///
/// JBinnedConstraint.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 "BinnedConstraint.hpp"



namespace margelo::nitro::camera {

  using namespace facebook;

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

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

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

} // namespace margelo::nitro::camera
