///
/// JTextShadow.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 "TextShadow.hpp"

#include <string>

namespace margelo::nitro::videopipeline {

  using namespace facebook;

  /**
   * The C++ JNI bridge between the C++ struct "TextShadow" and the the Kotlin data class "TextShadow".
   */
  struct JTextShadow final: public jni::JavaClass<JTextShadow> {
  public:
    static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/videopipeline/TextShadow;";

  public:
    /**
     * Convert this Java/Kotlin-based struct to the C++ struct TextShadow by copying all values to C++.
     */
    [[maybe_unused]]
    [[nodiscard]]
    TextShadow toCpp() const {
      static const auto clazz = javaClassStatic();
      static const auto fieldColor = clazz->getField<jni::JString>("color");
      jni::local_ref<jni::JString> color = this->getFieldValue(fieldColor);
      static const auto fieldBlur = clazz->getField<double>("blur");
      double blur = this->getFieldValue(fieldBlur);
      static const auto fieldDx = clazz->getField<double>("dx");
      double dx = this->getFieldValue(fieldDx);
      static const auto fieldDy = clazz->getField<double>("dy");
      double dy = this->getFieldValue(fieldDy);
      return TextShadow(
        color->toStdString(),
        blur,
        dx,
        dy
      );
    }

  public:
    /**
     * Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
     */
    [[maybe_unused]]
    static jni::local_ref<JTextShadow::javaobject> fromCpp(const TextShadow& value) {
      using JSignature = JTextShadow(jni::alias_ref<jni::JString>, double, double, double);
      static const auto clazz = javaClassStatic();
      static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
      return create(
        clazz,
        jni::make_jstring(value.color),
        value.blur,
        value.dx,
        value.dy
      );
    }
  };

} // namespace margelo::nitro::videopipeline
