///
/// JEventPropertiesOutput.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 <variant>

#include <string>
#include <variant>

namespace margelo::nitro::rive {

  using namespace facebook;

  /**
   * The C++ JNI bridge between the C++ std::variant and the Java class "EventPropertiesOutput".
   */
  class JEventPropertiesOutput: public jni::JavaClass<JEventPropertiesOutput> {
  public:
    static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/rive/EventPropertiesOutput;";

    static jni::local_ref<JEventPropertiesOutput> create_0(jboolean value) {
      static const auto method = javaClassStatic()->getStaticMethod<JEventPropertiesOutput(jboolean)>("create");
      return method(javaClassStatic(), value);
    }
    static jni::local_ref<JEventPropertiesOutput> create_1(jni::alias_ref<jni::JString> value) {
      static const auto method = javaClassStatic()->getStaticMethod<JEventPropertiesOutput(jni::alias_ref<jni::JString>)>("create");
      return method(javaClassStatic(), value);
    }
    static jni::local_ref<JEventPropertiesOutput> create_2(double value) {
      static const auto method = javaClassStatic()->getStaticMethod<JEventPropertiesOutput(double)>("create");
      return method(javaClassStatic(), value);
    }

    static jni::local_ref<JEventPropertiesOutput> fromCpp(const std::variant<bool, std::string, double>& variant) {
      switch (variant.index()) {
        case 0: return create_0(std::get<0>(variant));
        case 1: return create_1(jni::make_jstring(std::get<1>(variant)));
        case 2: return create_2(std::get<2>(variant));
        default: throw std::invalid_argument("Variant holds unknown index! (" + std::to_string(variant.index()) + ")");
      }
    }

    [[nodiscard]] std::variant<bool, std::string, double> toCpp() const;
  };

  namespace JEventPropertiesOutput_impl {
    class First final: public jni::JavaClass<First, JEventPropertiesOutput> {
    public:
      static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/rive/EventPropertiesOutput$First;";
    
      [[nodiscard]] jboolean getValue() const {
        static const auto field = javaClassStatic()->getField<jboolean>("value");
        return getFieldValue(field);
      }
    };
    
    class Second final: public jni::JavaClass<Second, JEventPropertiesOutput> {
    public:
      static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/rive/EventPropertiesOutput$Second;";
    
      [[nodiscard]] jni::local_ref<jni::JString> getValue() const {
        static const auto field = javaClassStatic()->getField<jni::JString>("value");
        return getFieldValue(field);
      }
    };
    
    class Third final: public jni::JavaClass<Third, JEventPropertiesOutput> {
    public:
      static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/rive/EventPropertiesOutput$Third;";
    
      [[nodiscard]] double getValue() const {
        static const auto field = javaClassStatic()->getField<double>("value");
        return getFieldValue(field);
      }
    };
  } // namespace JEventPropertiesOutput_impl
} // namespace margelo::nitro::rive
