///
/// JNitroInAppBrowserPresentationStyle.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 "NitroInAppBrowserPresentationStyle.hpp"

namespace margelo::nitro::nitroinappbrowser {

  using namespace facebook;

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

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

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

} // namespace margelo::nitro::nitroinappbrowser
