///
/// JPedometerResult.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 "PedometerResult.hpp"



namespace margelo::nitro::one {

  using namespace facebook;

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

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

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

} // namespace margelo::nitro::one
