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

#pragma once

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

namespace margelo::nitro::multipleimagepicker {

  using namespace facebook;

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

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

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

} // namespace margelo::nitro::multipleimagepicker
