/*
* Author:          Patrick-Christopher Mattulat
 * Co-Author:       Claude Sonnet 4.6 (LLM)
* Company:         Lynar Studios
* E-Mail:          webmaster@lynarstudios.com
* Created:         2023-04-07
* Changed:         2026-06-23
*
* */

#ifndef LS_STD_JNI_API_HPP
#define LS_STD_JNI_API_HPP

#include <ls-std/core/interface/IJniApi.hpp>
#include <ls-std/os/dynamic-goal.hpp>

/*
 * @doc: class(name: 'JniApi', package: 'core')
 * @doc: core.JniApi.description('This class represents an API for the Java Native Interface (JNI) wrapping basic JNI end points.')
 * */

namespace ls::standard::core::experimental
{
  class LS_STD_DYNAMIC_GOAL JniApi : public ls::standard::core::experimental::interface_type::IJniApi
  {
    public:

      explicit JniApi(JNIEnv *_environment);
      ~JniApi() noexcept override;

      jboolean callBooleanMethod(jobject _javaObject, jmethodID _methodId) override;
      jbyte callByteMethod(jobject _javaObject, jmethodID _methodId) override;
      jchar callCharMethod(jobject _javaObject, jmethodID _methodId) override;
      jdouble callDoubleMethod(jobject _javaObject, jmethodID _methodId) override;
      jfloat callFloatMethod(jobject _javaObject, jmethodID _methodId) override;
      jint callIntMethod(jobject _javaObject, jmethodID _methodId) override;
      jlong callLongMethod(jobject _javaObject, jmethodID _methodId) override;
      jshort callShortMethod(jobject _javaObject, jmethodID _methodId) override;
      jclass findClass(const ::std::string &_classPath) override;
      jmethodID getMethodId(jclass _javaClass, const char *_methodIdentifier, const char *_methodSignature) override;

    private:

      JNIEnv *environment{};
  };
}

#endif
