///
/// JCircularLocationBounds.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 "CircularLocationBounds.hpp"



namespace margelo::nitro::googleplaces {

  using namespace facebook;

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

  public:
    /**
     * Convert this Java/Kotlin-based struct to the C++ struct CircularLocationBounds by copying all values to C++.
     */
    [[maybe_unused]]
    [[nodiscard]]
    CircularLocationBounds toCpp() const {
      static const auto clazz = javaClassStatic();
      static const auto fieldLatitude = clazz->getField<double>("latitude");
      double latitude = this->getFieldValue(fieldLatitude);
      static const auto fieldLongitude = clazz->getField<double>("longitude");
      double longitude = this->getFieldValue(fieldLongitude);
      static const auto fieldRadius = clazz->getField<double>("radius");
      double radius = this->getFieldValue(fieldRadius);
      return CircularLocationBounds(
        latitude,
        longitude,
        radius
      );
    }

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

} // namespace margelo::nitro::googleplaces
