///
/// JPresentation.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 "Presentation.hpp"

namespace margelo::nitro::multipleimagepicker {

  using namespace facebook;

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

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

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

} // namespace margelo::nitro::multipleimagepicker
