///
/// JDepthDataQuality.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 "DepthDataQuality.hpp"

namespace margelo::nitro::camera {

  using namespace facebook;

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

  public:
    /**
     * Convert this Java/Kotlin-based enum to the C++ enum DepthDataQuality.
     */
    [[maybe_unused]]
    [[nodiscard]]
    DepthDataQuality toCpp() const {
      static const auto clazz = javaClassStatic();
      static const auto fieldOrdinal = clazz->getField<int>("value");
      int ordinal = this->getFieldValue(fieldOrdinal);
      return static_cast<DepthDataQuality>(ordinal);
    }

  public:
    /**
     * Create a Java/Kotlin-based enum with the given C++ enum's value.
     */
    [[maybe_unused]]
    static jni::alias_ref<JDepthDataQuality> fromCpp(DepthDataQuality value) {
      static const auto clazz = javaClassStatic();
      switch (value) {
        case DepthDataQuality::UNKNOWN:
          static const auto fieldUNKNOWN = clazz->getStaticField<JDepthDataQuality>("UNKNOWN");
          return clazz->getStaticFieldValue(fieldUNKNOWN);
        case DepthDataQuality::LOW:
          static const auto fieldLOW = clazz->getStaticField<JDepthDataQuality>("LOW");
          return clazz->getStaticFieldValue(fieldLOW);
        case DepthDataQuality::HIGH:
          static const auto fieldHIGH = clazz->getStaticField<JDepthDataQuality>("HIGH");
          return clazz->getStaticFieldValue(fieldHIGH);
        default:
          std::string stringValue = std::to_string(static_cast<int>(value));
          throw std::invalid_argument("Invalid enum value (" + stringValue + "!");
      }
    }
  };

} // namespace margelo::nitro::camera
