chromium/third_party/jni_zero/test/golden/testPackagePrefixGenerator-SampleForTests_jni.h.golden

// This file was generated by
//     //third_party/jni_zero/jni_zero.py
// For
//     this.is.a.package.prefix.org.jni_zero.SampleForTests

#ifndef this_is_a_package_prefix_org_jni_1zero_SampleForTests_JNI
#define this_is_a_package_prefix_org_jni_1zero_SampleForTests_JNI

#include <jni.h>

#include "third_party/jni_zero/jni_export.h"
#include "third_party/jni_zero/jni_zero_helper.h"
// Class Accessors.
#ifndef this_is_a_package_prefix_org_jni_1zero_SampleForTests_clazz_defined
#define this_is_a_package_prefix_org_jni_1zero_SampleForTests_clazz_defined
inline jclass this_is_a_package_prefix_org_jni_1zero_SampleForTests_clazz(JNIEnv* env) {
  static const char kClassName[] = "this/is/a/package/prefix/org/jni_zero/SampleForTests";
  static std::atomic<jclass> cached_class;
  return jni_zero::internal::LazyGetClass(env, kClassName, &cached_class);
}
#endif

#ifndef this_is_a_package_prefix_org_jni_1zero_SampleForTests_00024InnerStructA_clazz_defined
#define this_is_a_package_prefix_org_jni_1zero_SampleForTests_00024InnerStructA_clazz_defined
inline jclass this_is_a_package_prefix_org_jni_1zero_SampleForTests_00024InnerStructA_clazz(JNIEnv* env) {
  static const char kClassName[] = "this/is/a/package/prefix/org/jni_zero/SampleForTests$InnerStructA";
  static std::atomic<jclass> cached_class;
  return jni_zero::internal::LazyGetClass(env, kClassName, &cached_class);
}
#endif

#ifndef this_is_a_package_prefix_org_jni_1zero_SampleForTests_00024InnerStructB_clazz_defined
#define this_is_a_package_prefix_org_jni_1zero_SampleForTests_00024InnerStructB_clazz_defined
inline jclass this_is_a_package_prefix_org_jni_1zero_SampleForTests_00024InnerStructB_clazz(JNIEnv* env) {
  static const char kClassName[] = "this/is/a/package/prefix/org/jni_zero/SampleForTests$InnerStructB";
  static std::atomic<jclass> cached_class;
  return jni_zero::internal::LazyGetClass(env, kClassName, &cached_class);
}
#endif

namespace jni_zero {
namespace tests {
// Java to native functions
JNI_POSSIBLE_BOUNDARY_EXPORT void Java_this_is_a_package_prefix_org_jni_1zero_GEN_1JNI_this_1is_1a_1package_1prefix_1org_1jni_11zero_1SampleForTests_1addStructB(
    JNIEnv* env,
    jclass jcaller,
    jlong nativeCPPClass,
    jobject caller,
    jobject b) {
  reinterpret_cast<CPPClass*>(nativeCPPClass)->AddStructB(
      env,
      jni_zero::JavaParamRef<jobject>(env, caller),
      jni_zero::JavaParamRef<jobject>(env, b));
}

// Forward declaration. To be implemented by the including .cc file.
static void JNI_SampleForTests_ClassUnderSamePackageTest(
    JNIEnv* env,
    const jni_zero::JavaParamRef<jobject>& arg);

JNI_POSSIBLE_BOUNDARY_EXPORT void Java_this_is_a_package_prefix_org_jni_1zero_GEN_1JNI_this_1is_1a_1package_1prefix_1org_1jni_11zero_1SampleForTests_1classUnderSamePackageTest(
    JNIEnv* env,
    jclass jcaller,
    jobject arg) {
  JNI_SampleForTests_ClassUnderSamePackageTest(
      env,
      jni_zero::JavaParamRef<jobject>(env, arg));
}

JNI_POSSIBLE_BOUNDARY_EXPORT void Java_this_is_a_package_prefix_org_jni_1zero_GEN_1JNI_this_1is_1a_1package_1prefix_1org_1jni_11zero_1SampleForTests_1destroy(
    JNIEnv* env,
    jclass jcaller,
    jlong nativeCPPClass,
    jobject caller,
    jobject bytes) {
  std::vector<uint8_t> bytes_converted = jni_zero::FromJniArray<std::vector<uint8_t>>(
      env,
      jni_zero::JavaParamRef<jbyteArray>(env, static_cast<jbyteArray>(bytes)));
  reinterpret_cast<CPPClass*>(nativeCPPClass)->Destroy(
      env,
      jni_zero::JavaParamRef<jobject>(env, caller),
      bytes_converted);
}

// Forward declaration. To be implemented by the including .cc file.
static jni_zero::ScopedJavaLocalRef<jclass> JNI_SampleForTests_GetClass(
    JNIEnv* env,
    const jni_zero::JavaParamRef<jclass>& _env);

JNI_POSSIBLE_BOUNDARY_EXPORT jobject Java_this_is_a_package_prefix_org_jni_1zero_GEN_1JNI_this_1is_1a_1package_1prefix_1org_1jni_11zero_1SampleForTests_1getClass(
    JNIEnv* env,
    jclass jcaller,
    jobject _env) {
  auto _ret = JNI_SampleForTests_GetClass(
      env,
      jni_zero::JavaParamRef<jclass>(env, static_cast<jclass>(_env)));
  return _ret.ReleaseLocal();
}

// Forward declaration. To be implemented by the including .cc file.
static jdouble JNI_SampleForTests_GetDoubleFunction(
    JNIEnv* env,
    const jni_zero::JavaParamRef<jobject>& ret);

JNI_POSSIBLE_BOUNDARY_EXPORT jdouble Java_this_is_a_package_prefix_org_jni_1zero_GEN_1JNI_this_1is_1a_1package_1prefix_1org_1jni_11zero_1SampleForTests_1getDoubleFunction(
    JNIEnv* env,
    jclass jcaller,
    jobject ret) {
  auto _ret = JNI_SampleForTests_GetDoubleFunction(
      env,
      jni_zero::JavaParamRef<jobject>(env, ret));
  return _ret;
}

// Forward declaration. To be implemented by the including .cc file.
static jfloat JNI_SampleForTests_GetFloatFunction(JNIEnv* env);

JNI_POSSIBLE_BOUNDARY_EXPORT jfloat Java_this_is_a_package_prefix_org_jni_1zero_GEN_1JNI_this_1is_1a_1package_1prefix_1org_1jni_11zero_1SampleForTests_1getFloatFunction(
    JNIEnv* env,
    jclass jcaller) {
  auto _ret = JNI_SampleForTests_GetFloatFunction(env);
  return _ret;
}

// Forward declaration. To be implemented by the including .cc file.
static jni_zero::ScopedJavaLocalRef<jobject> JNI_SampleForTests_GetNonPODDatatype(
    JNIEnv* env,
    const jni_zero::JavaParamRef<jobject>& _jcaller);

JNI_POSSIBLE_BOUNDARY_EXPORT jobject Java_this_is_a_package_prefix_org_jni_1zero_GEN_1JNI_this_1is_1a_1package_1prefix_1org_1jni_11zero_1SampleForTests_1getNonPODDatatype(
    JNIEnv* env,
    jclass jcaller,
    jobject _jcaller) {
  auto _ret = JNI_SampleForTests_GetNonPODDatatype(
      env,
      jni_zero::JavaParamRef<jobject>(env, _jcaller));
  return _ret.ReleaseLocal();
}

// Forward declaration. To be implemented by the including .cc file.
static jni_zero::ScopedJavaLocalRef<jthrowable> JNI_SampleForTests_GetThrowable(
    JNIEnv* env,
    const jni_zero::JavaParamRef<jthrowable>& arg0);

JNI_POSSIBLE_BOUNDARY_EXPORT jobject Java_this_is_a_package_prefix_org_jni_1zero_GEN_1JNI_this_1is_1a_1package_1prefix_1org_1jni_11zero_1SampleForTests_1getThrowable(
    JNIEnv* env,
    jclass jcaller,
    jobject arg0) {
  auto _ret = JNI_SampleForTests_GetThrowable(
      env,
      jni_zero::JavaParamRef<jthrowable>(env, static_cast<jthrowable>(arg0)));
  return _ret.ReleaseLocal();
}

// Forward declaration. To be implemented by the including .cc file.
static jlong JNI_SampleForTests_Init(
    JNIEnv* env,
    const jni_zero::JavaParamRef<jobject>& caller,
    const jni_zero::JavaParamRef<jstring>& param,
    jni_zero::ByteArrayView& bytes,
    jni_zero::tests::CPPClass* convertedType,
    std::vector<jni_zero::ScopedJavaLocalRef<jobject>>& nonConvertedArray);

JNI_POSSIBLE_BOUNDARY_EXPORT jlong Java_this_is_a_package_prefix_org_jni_1zero_GEN_1JNI_this_1is_1a_1package_1prefix_1org_1jni_11zero_1SampleForTests_1init(
    JNIEnv* env,
    jclass jcaller,
    jobject caller,
    jobject param,
    jobject bytes,
    jobject convertedType,
    jobject nonConvertedArray) {
  jni_zero::ByteArrayView bytes_converted = jni_zero::FromJniArray<jni_zero::ByteArrayView>(
      env,
      jni_zero::JavaParamRef<jbyteArray>(env, static_cast<jbyteArray>(bytes)));
  jni_zero::tests::CPPClass* convertedType_converted = jni_zero::FromJniType<jni_zero::tests::CPPClass*>(
      env,
      jni_zero::JavaParamRef<jobject>(env, convertedType));
  std::vector<jni_zero::ScopedJavaLocalRef<jobject>> nonConvertedArray_converted = jni_zero::FromJniArray<std::vector<jni_zero::ScopedJavaLocalRef<jobject>>>(
      env,
      jni_zero::JavaParamRef<jobjectArray>(env, static_cast<jobjectArray>(nonConvertedArray)));
  auto _ret = JNI_SampleForTests_Init(
      env,
      jni_zero::JavaParamRef<jobject>(env, caller),
      jni_zero::JavaParamRef<jstring>(env, static_cast<jstring>(param)),
      bytes_converted,
      convertedType_converted,
      nonConvertedArray_converted);
  return _ret;
}

JNI_POSSIBLE_BOUNDARY_EXPORT void Java_this_is_a_package_prefix_org_jni_1zero_GEN_1JNI_this_1is_1a_1package_1prefix_1org_1jni_11zero_1SampleForTests_1iterateAndDoSomethingWithStructB(
    JNIEnv* env,
    jclass jcaller,
    jlong nativeCPPClass,
    jobject caller) {
  reinterpret_cast<CPPClass*>(nativeCPPClass)->IterateAndDoSomethingWithStructB(
      env,
      jni_zero::JavaParamRef<jobject>(env, caller));
}

// Forward declaration. To be implemented by the including .cc file.
static std::vector<jni_zero::ScopedJavaLocalRef<jobject>> JNI_SampleForTests_ListTest2(
    JNIEnv* env,
    std::vector<std::string>& items);

JNI_POSSIBLE_BOUNDARY_EXPORT jobject Java_this_is_a_package_prefix_org_jni_1zero_GEN_1JNI_this_1is_1a_1package_1prefix_1org_1jni_11zero_1SampleForTests_1listTest2(
    JNIEnv* env,
    jclass jcaller,
    jobject items) {
  std::vector<std::string> items_converted = jni_zero::FromJniCollection<std::vector<std::string>>(
      env,
      jni_zero::JavaParamRef<jobject>(env, items));
  auto _ret = JNI_SampleForTests_ListTest2(env, items_converted);
  jobject converted_ret = jni_zero::ToJniList(env, _ret).Release();
  return converted_ret;
}

// Forward declaration. To be implemented by the including .cc file.
static std::map<std::string, std::string> JNI_SampleForTests_MapTest2(
    JNIEnv* env,
    std::map<std::string, std::string>& arg0);

JNI_POSSIBLE_BOUNDARY_EXPORT jobject Java_this_is_a_package_prefix_org_jni_1zero_GEN_1JNI_this_1is_1a_1package_1prefix_1org_1jni_11zero_1SampleForTests_1mapTest2(
    JNIEnv* env,
    jclass jcaller,
    jobject arg0) {
  std::map<std::string, std::string> arg0_converted = jni_zero::FromJniType<std::map<std::string, std::string>>(
      env,
      jni_zero::JavaParamRef<jobject>(env, arg0));
  auto _ret = JNI_SampleForTests_MapTest2(env, arg0_converted);
  jobject converted_ret = jni_zero::ToJniType(env, _ret).Release();
  return converted_ret;
}

JNI_POSSIBLE_BOUNDARY_EXPORT jint Java_this_is_a_package_prefix_org_jni_1zero_GEN_1JNI_this_1is_1a_1package_1prefix_1org_1jni_11zero_1SampleForTests_1method(
    JNIEnv* env,
    jclass jcaller,
    jlong nativeCPPClass,
    jobject caller,
    jobject strings) {
  std::vector<std::string> strings_converted = jni_zero::FromJniArray<std::vector<std::string>>(
      env,
      jni_zero::JavaParamRef<jobjectArray>(env, static_cast<jobjectArray>(strings)));
  auto _ret = reinterpret_cast<CPPClass*>(nativeCPPClass)->Method(
      env,
      jni_zero::JavaParamRef<jobject>(env, caller),
      strings_converted);
  return _ret;
}

JNI_POSSIBLE_BOUNDARY_EXPORT jdouble Java_this_is_a_package_prefix_org_jni_1zero_GEN_1JNI_this_1is_1a_1package_1prefix_1org_1jni_11zero_1SampleForTests_1methodOtherP0(
    JNIEnv* env,
    jclass jcaller,
    jlong nativePtr,
    jobject caller) {
  auto _ret = reinterpret_cast<CPPClass::InnerClass*>(nativePtr)->MethodOtherP0(
      env,
      jni_zero::JavaParamRef<jobject>(env, caller));
  return _ret;
}

// Forward declaration. To be implemented by the including .cc file.
static std::vector<bool> JNI_SampleForTests_PrimitiveArrays(
    JNIEnv* env,
    std::vector<uint8_t>& b,
    std::vector<uint16_t>& c,
    std::vector<int16_t>& s,
    std::vector<int32_t>& i,
    std::vector<int64_t>& l,
    std::vector<float>& f,
    std::vector<double>& d);

JNI_POSSIBLE_BOUNDARY_EXPORT jobject Java_this_is_a_package_prefix_org_jni_1zero_GEN_1JNI_this_1is_1a_1package_1prefix_1org_1jni_11zero_1SampleForTests_1primitiveArrays(
    JNIEnv* env,
    jclass jcaller,
    jobject b,
    jobject c,
    jobject s,
    jobject i,
    jobject l,
    jobject f,
    jobject d) {
  std::vector<uint8_t> b_converted = jni_zero::FromJniArray<std::vector<uint8_t>>(
      env,
      jni_zero::JavaParamRef<jbyteArray>(env, static_cast<jbyteArray>(b)));
  std::vector<uint16_t> c_converted = jni_zero::FromJniArray<std::vector<uint16_t>>(
      env,
      jni_zero::JavaParamRef<jcharArray>(env, static_cast<jcharArray>(c)));
  std::vector<int16_t> s_converted = jni_zero::FromJniArray<std::vector<int16_t>>(
      env,
      jni_zero::JavaParamRef<jshortArray>(env, static_cast<jshortArray>(s)));
  std::vector<int32_t> i_converted = jni_zero::FromJniArray<std::vector<int32_t>>(
      env,
      jni_zero::JavaParamRef<jintArray>(env, static_cast<jintArray>(i)));
  std::vector<int64_t> l_converted = jni_zero::FromJniArray<std::vector<int64_t>>(
      env,
      jni_zero::JavaParamRef<jlongArray>(env, static_cast<jlongArray>(l)));
  std::vector<float> f_converted = jni_zero::FromJniArray<std::vector<float>>(
      env,
      jni_zero::JavaParamRef<jfloatArray>(env, static_cast<jfloatArray>(f)));
  std::vector<double> d_converted = jni_zero::FromJniArray<std::vector<double>>(
      env,
      jni_zero::JavaParamRef<jdoubleArray>(env, static_cast<jdoubleArray>(d)));
  auto _ret = JNI_SampleForTests_PrimitiveArrays(
      env,
      b_converted,
      c_converted,
      s_converted,
      i_converted,
      l_converted,
      f_converted,
      d_converted);
  jobject converted_ret = jni_zero::ToJniArray(env, _ret).Release();
  return converted_ret;
}

JNI_POSSIBLE_BOUNDARY_EXPORT jobject Java_this_is_a_package_prefix_org_jni_1zero_GEN_1JNI_this_1is_1a_1package_1prefix_1org_1jni_11zero_1SampleForTests_1returnAString(
    JNIEnv* env,
    jclass jcaller,
    jlong nativeCPPClass,
    jobject caller) {
  auto _ret = reinterpret_cast<CPPClass*>(nativeCPPClass)->ReturnAString(
      env,
      jni_zero::JavaParamRef<jobject>(env, caller));
  return _ret.ReleaseLocal();
}

// Forward declaration. To be implemented by the including .cc file.
static void JNI_SampleForTests_SetNonPODDatatype(
    JNIEnv* env,
    const jni_zero::JavaParamRef<jobject>& obj,
    const jni_zero::JavaParamRef<jobject>& rect);

JNI_POSSIBLE_BOUNDARY_EXPORT void Java_this_is_a_package_prefix_org_jni_1zero_GEN_1JNI_this_1is_1a_1package_1prefix_1org_1jni_11zero_1SampleForTests_1setNonPODDatatype(
    JNIEnv* env,
    jclass jcaller,
    jobject obj,
    jobject rect) {
  JNI_SampleForTests_SetNonPODDatatype(
      env,
      jni_zero::JavaParamRef<jobject>(env, obj),
      jni_zero::JavaParamRef<jobject>(env, rect));
}

// Native to Java functions
static jni_zero::ScopedJavaLocalRef<jobject> Java_SampleForTests_Constructor(
    JNIEnv* env,
    JniIntWrapper foo,
    JniIntWrapper bar) {
  static std::atomic<jmethodID> cached_method_id(nullptr);
  jclass clazz = this_is_a_package_prefix_org_jni_1zero_SampleForTests_clazz(env);
  CHECK_CLAZZ(env, clazz, clazz, nullptr);
  jni_zero::internal::JniJavaCallContext<true> call_context;
  call_context.Init<jni_zero::MethodID::TYPE_INSTANCE>(
      env,
      clazz,
      "<init>",
      "(II)V",
      &cached_method_id);
  auto _ret = env->NewObject(
      clazz,
      call_context.method_id(),
      as_jint(foo),
      as_jint(bar));
  return jni_zero::ScopedJavaLocalRef<jobject>(env, _ret);
}

static void Java_SampleForTests_addStructA(
    JNIEnv* env,
    const jni_zero::JavaRef<jobject>& obj,
    const jni_zero::JavaRef<jobject>& a) {
  static std::atomic<jmethodID> cached_method_id(nullptr);
  jclass clazz = this_is_a_package_prefix_org_jni_1zero_SampleForTests_clazz(env);
  CHECK_CLAZZ(env, obj.obj(), clazz);
  jni_zero::internal::JniJavaCallContext<true> call_context;
  call_context.Init<jni_zero::MethodID::TYPE_INSTANCE>(
      env,
      clazz,
      "addStructA",
      "(Lthis/is/a/package/prefix/org/jni_zero/SampleForTests$InnerStructA;)V",
      &cached_method_id);
  env->CallVoidMethod(obj.obj(), call_context.method_id(), a.obj());
}

static jni_zero::ScopedJavaLocalRef<jclass> Java_SampleForTests_getClass(
    JNIEnv* env,
    const jni_zero::JavaRef<jobject>& obj,
    const jni_zero::JavaRef<jclass>& arg0) {
  static std::atomic<jmethodID> cached_method_id(nullptr);
  jclass clazz = this_is_a_package_prefix_org_jni_1zero_SampleForTests_clazz(env);
  CHECK_CLAZZ(env, obj.obj(), clazz, nullptr);
  jni_zero::internal::JniJavaCallContext<true> call_context;
  call_context.Init<jni_zero::MethodID::TYPE_INSTANCE>(
      env,
      clazz,
      "getClass",
      "(Ljava/lang/Class;)Ljava/lang/Class;",
      &cached_method_id);
  auto _ret = env->CallObjectMethod(
      obj.obj(),
      call_context.method_id(),
      arg0.obj());
  jclass _ret2 = static_cast<jclass>(_ret);
  return jni_zero::ScopedJavaLocalRef<jclass>(env, _ret2);
}

static std::string Java_SampleForTests_getFirstString(
    JNIEnv* env,
    const jni_zero::JavaRef<jobject>& obj,
    std::vector<const char*> const& array,
    const char* const& finalArg) {
  static std::atomic<jmethodID> cached_method_id(nullptr);
  jclass clazz = this_is_a_package_prefix_org_jni_1zero_SampleForTests_clazz(env);
  CHECK_CLAZZ(env, obj.obj(), clazz, nullptr);
  jni_zero::internal::JniJavaCallContext<true> call_context;
  call_context.Init<jni_zero::MethodID::TYPE_INSTANCE>(
      env,
      clazz,
      "getFirstString",
      "([Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;",
      &cached_method_id);
  jni_zero::ScopedJavaLocalRef<jobject> converted_array = jni_zero::ToJniArray(
      env,
      array,
      jni_zero::g_string_class);
  jni_zero::ScopedJavaLocalRef<jobject> converted_finalArg = jni_zero::ToJniType(
      env,
      finalArg);
  auto _ret = env->CallObjectMethod(
      obj.obj(),
      call_context.method_id(),
      converted_array.obj(),
      converted_finalArg.obj());
  return jni_zero::FromJniType<std::string>(
      env,
      jni_zero::ScopedJavaLocalRef<jobject>(env, _ret));
}

static jni_zero::ScopedJavaLocalRef<jobject> Java_SampleForTests_getInnerEnum(
    JNIEnv* env) {
  static std::atomic<jmethodID> cached_method_id(nullptr);
  jclass clazz = this_is_a_package_prefix_org_jni_1zero_SampleForTests_clazz(env);
  CHECK_CLAZZ(env, clazz, clazz, nullptr);
  jni_zero::internal::JniJavaCallContext<true> call_context;
  call_context.Init<jni_zero::MethodID::TYPE_STATIC>(
      env,
      clazz,
      "getInnerEnum",
      "()Lthis/is/a/package/prefix/org/jni_zero/SampleForTests$InnerEnum;",
      &cached_method_id);
  auto _ret = env->CallStaticObjectMethod(clazz, call_context.method_id());
  return jni_zero::ScopedJavaLocalRef<jobject>(env, _ret);
}

static jni_zero::ScopedJavaLocalRef<jobject> Java_SampleForTests_getInnerEnum(
    JNIEnv* env,
    JniIntWrapper a) {
  static std::atomic<jmethodID> cached_method_id(nullptr);
  jclass clazz = this_is_a_package_prefix_org_jni_1zero_SampleForTests_clazz(env);
  CHECK_CLAZZ(env, clazz, clazz, nullptr);
  jni_zero::internal::JniJavaCallContext<true> call_context;
  call_context.Init<jni_zero::MethodID::TYPE_STATIC>(
      env,
      clazz,
      "getInnerEnum",
      "(I)Lthis/is/a/package/prefix/org/jni_zero/SampleForTests$InnerEnum;",
      &cached_method_id);
  auto _ret = env->CallStaticObjectMethod(
      clazz,
      call_context.method_id(),
      as_jint(a));
  return jni_zero::ScopedJavaLocalRef<jobject>(env, _ret);
}

static jni_zero::ScopedJavaLocalRef<jobject> Java_SampleForTests_getInnerInterface(
    JNIEnv* env) {
  static std::atomic<jmethodID> cached_method_id(nullptr);
  jclass clazz = this_is_a_package_prefix_org_jni_1zero_SampleForTests_clazz(env);
  CHECK_CLAZZ(env, clazz, clazz, nullptr);
  jni_zero::internal::JniJavaCallContext<true> call_context;
  call_context.Init<jni_zero::MethodID::TYPE_STATIC>(
      env,
      clazz,
      "getInnerInterface",
      "()Lthis/is/a/package/prefix/org/jni_zero/SampleForTests$InnerInterface;",
      &cached_method_id);
  auto _ret = env->CallStaticObjectMethod(clazz, call_context.method_id());
  return jni_zero::ScopedJavaLocalRef<jobject>(env, _ret);
}

static jni_zero::ScopedJavaLocalRef<jthrowable> Java_SampleForTests_getThrowable(
    JNIEnv* env,
    const jni_zero::JavaRef<jobject>& obj,
    const jni_zero::JavaRef<jthrowable>& arg0) {
  static std::atomic<jmethodID> cached_method_id(nullptr);
  jclass clazz = this_is_a_package_prefix_org_jni_1zero_SampleForTests_clazz(env);
  CHECK_CLAZZ(env, obj.obj(), clazz, nullptr);
  jni_zero::internal::JniJavaCallContext<true> call_context;
  call_context.Init<jni_zero::MethodID::TYPE_INSTANCE>(
      env,
      clazz,
      "getThrowable",
      "(Ljava/lang/Throwable;)Ljava/lang/Throwable;",
      &cached_method_id);
  auto _ret = env->CallObjectMethod(
      obj.obj(),
      call_context.method_id(),
      arg0.obj());
  jthrowable _ret2 = static_cast<jthrowable>(_ret);
  return jni_zero::ScopedJavaLocalRef<jthrowable>(env, _ret2);
}

static void Java_SampleForTests_iterateAndDoSomething(
    JNIEnv* env,
    const jni_zero::JavaRef<jobject>& obj) {
  static std::atomic<jmethodID> cached_method_id(nullptr);
  jclass clazz = this_is_a_package_prefix_org_jni_1zero_SampleForTests_clazz(env);
  CHECK_CLAZZ(env, obj.obj(), clazz);
  jni_zero::internal::JniJavaCallContext<true> call_context;
  call_context.Init<jni_zero::MethodID::TYPE_INSTANCE>(
      env,
      clazz,
      "iterateAndDoSomething",
      "()V",
      &cached_method_id);
  env->CallVoidMethod(obj.obj(), call_context.method_id());
}

static jint Java_SampleForTests_javaMethod(
    JNIEnv* env,
    const jni_zero::JavaRef<jobject>& obj,
    JniIntWrapper _jcaller,
    JniIntWrapper ret) {
  static std::atomic<jmethodID> cached_method_id(nullptr);
  jclass clazz = this_is_a_package_prefix_org_jni_1zero_SampleForTests_clazz(env);
  CHECK_CLAZZ(env, obj.obj(), clazz, 0);
  jni_zero::internal::JniJavaCallContext<true> call_context;
  call_context.Init<jni_zero::MethodID::TYPE_INSTANCE>(
      env,
      clazz,
      "javaMethod",
      "(II)I",
      &cached_method_id);
  auto _ret = env->CallIntMethod(
      obj.obj(),
      call_context.method_id(),
      as_jint(_jcaller),
      as_jint(ret));
  return _ret;
}

static std::vector<int32_t> Java_SampleForTests_jniTypesAndAnnotations(
    JNIEnv* env,
    const jni_zero::JavaRef<jobject>& obj,
    MyEnum foo,
    std::vector<int32_t> const& bar,
    JniIntWrapper baz,
    long bat) {
  static std::atomic<jmethodID> cached_method_id(nullptr);
  jclass clazz = this_is_a_package_prefix_org_jni_1zero_SampleForTests_clazz(env);
  CHECK_CLAZZ(env, obj.obj(), clazz, nullptr);
  jni_zero::internal::JniJavaCallContext<true> call_context;
  call_context.Init<jni_zero::MethodID::TYPE_INSTANCE>(
      env,
      clazz,
      "jniTypesAndAnnotations",
      "(I[IIJ)[I",
      &cached_method_id);
  jint converted_foo = static_cast<jint>(foo);
  jni_zero::ScopedJavaLocalRef<jobject> converted_bar = jni_zero::ToJniArray(
      env,
      bar);
  jlong converted_bat = static_cast<jlong>(bat);
  auto _ret = env->CallObjectMethod(
      obj.obj(),
      call_context.method_id(),
      converted_foo,
      converted_bar.obj(),
      as_jint(baz),
      converted_bat);
  return jni_zero::FromJniArray<std::vector<int32_t>>(
      env,
      jni_zero::ScopedJavaLocalRef<jintArray>(env, static_cast<jintArray>(_ret)));
}

static std::vector<jni_zero::ScopedJavaLocalRef<jobject>> Java_SampleForTests_listTest1(
    JNIEnv* env,
    std::vector<std::string> const& items) {
  static std::atomic<jmethodID> cached_method_id(nullptr);
  jclass clazz = this_is_a_package_prefix_org_jni_1zero_SampleForTests_clazz(env);
  CHECK_CLAZZ(env, clazz, clazz, nullptr);
  jni_zero::internal::JniJavaCallContext<true> call_context;
  call_context.Init<jni_zero::MethodID::TYPE_STATIC>(
      env,
      clazz,
      "listTest1",
      "(Ljava/util/List;)Ljava/util/Collection;",
      &cached_method_id);
  jni_zero::ScopedJavaLocalRef<jobject> converted_items = jni_zero::ToJniList(
      env,
      items);
  auto _ret = env->CallStaticObjectMethod(
      clazz,
      call_context.method_id(),
      converted_items.obj());
  return jni_zero::FromJniCollection<std::vector<jni_zero::ScopedJavaLocalRef<jobject>>>(
      env,
      jni_zero::ScopedJavaLocalRef<jobject>(env, _ret));
}

static std::map<std::string, std::string> Java_SampleForTests_mapTest1(
    JNIEnv* env,
    std::map<std::string, std::string> const& arg0) {
  static std::atomic<jmethodID> cached_method_id(nullptr);
  jclass clazz = this_is_a_package_prefix_org_jni_1zero_SampleForTests_clazz(env);
  CHECK_CLAZZ(env, clazz, clazz, nullptr);
  jni_zero::internal::JniJavaCallContext<true> call_context;
  call_context.Init<jni_zero::MethodID::TYPE_STATIC>(
      env,
      clazz,
      "mapTest1",
      "(Ljava/util/Map;)Ljava/util/Map;",
      &cached_method_id);
  jni_zero::ScopedJavaLocalRef<jobject> converted_arg0 = jni_zero::ToJniType(
      env,
      arg0);
  auto _ret = env->CallStaticObjectMethod(
      clazz,
      call_context.method_id(),
      converted_arg0.obj());
  return jni_zero::FromJniType<std::map<std::string, std::string>>(
      env,
      jni_zero::ScopedJavaLocalRef<jobject>(env, _ret));
}

static void Java_SampleForTests_methodThatThrowsException(
    JNIEnv* env,
    const jni_zero::JavaRef<jobject>& obj) {
  static std::atomic<jmethodID> cached_method_id(nullptr);
  jclass clazz = this_is_a_package_prefix_org_jni_1zero_SampleForTests_clazz(env);
  CHECK_CLAZZ(env, obj.obj(), clazz);
  jni_zero::internal::JniJavaCallContext<false> call_context;
  call_context.Init<jni_zero::MethodID::TYPE_INSTANCE>(
      env,
      clazz,
      "methodThatThrowsException",
      "()V",
      &cached_method_id);
  env->CallVoidMethod(obj.obj(), call_context.method_id());
}

static jboolean Java_SampleForTests_methodWithAnnotationParamAssignment(
    JNIEnv* env,
    const jni_zero::JavaRef<jobject>& obj) {
  static std::atomic<jmethodID> cached_method_id(nullptr);
  jclass clazz = this_is_a_package_prefix_org_jni_1zero_SampleForTests_clazz(env);
  CHECK_CLAZZ(env, obj.obj(), clazz, false);
  jni_zero::internal::JniJavaCallContext<true> call_context;
  call_context.Init<jni_zero::MethodID::TYPE_INSTANCE>(
      env,
      clazz,
      "methodWithAnnotationParamAssignment",
      "()Z",
      &cached_method_id);
  auto _ret = env->CallBooleanMethod(obj.obj(), call_context.method_id());
  return _ret;
}

static void Java_SampleForTests_methodWithGenericParams(
    JNIEnv* env,
    const jni_zero::JavaRef<jobject>& obj,
    const jni_zero::JavaRef<jobject>& _env,
    const jni_zero::JavaRef<jobject>& bar) {
  static std::atomic<jmethodID> cached_method_id(nullptr);
  jclass clazz = this_is_a_package_prefix_org_jni_1zero_SampleForTests_clazz(env);
  CHECK_CLAZZ(env, obj.obj(), clazz);
  jni_zero::internal::JniJavaCallContext<true> call_context;
  call_context.Init<jni_zero::MethodID::TYPE_INSTANCE>(
      env,
      clazz,
      "methodWithGenericParams",
      "(Ljava/util/Map;Ljava/util/LinkedList;)V",
      &cached_method_id);
  env->CallVoidMethod(
      obj.obj(),
      call_context.method_id(),
      _env.obj(),
      bar.obj());
}

static void Java_SampleForTests_packagePrivateJavaMethod(
    JNIEnv* env,
    const jni_zero::JavaRef<jobject>& obj) {
  static std::atomic<jmethodID> cached_method_id(nullptr);
  jclass clazz = this_is_a_package_prefix_org_jni_1zero_SampleForTests_clazz(env);
  CHECK_CLAZZ(env, obj.obj(), clazz);
  jni_zero::internal::JniJavaCallContext<true> call_context;
  call_context.Init<jni_zero::MethodID::TYPE_INSTANCE>(
      env,
      clazz,
      "packagePrivateJavaMethod",
      "()V",
      &cached_method_id);
  env->CallVoidMethod(obj.obj(), call_context.method_id());
}

static std::vector<bool> Java_SampleForTests_primitiveArrays(
    JNIEnv* env,
    std::vector<uint8_t> const& b,
    std::vector<uint16_t> const& c,
    std::vector<int16_t> const& s,
    std::vector<int32_t> const& i,
    std::vector<int64_t> const& l,
    std::vector<float> const& f,
    std::vector<double> const& d) {
  static std::atomic<jmethodID> cached_method_id(nullptr);
  jclass clazz = this_is_a_package_prefix_org_jni_1zero_SampleForTests_clazz(env);
  CHECK_CLAZZ(env, clazz, clazz, nullptr);
  jni_zero::internal::JniJavaCallContext<true> call_context;
  call_context.Init<jni_zero::MethodID::TYPE_STATIC>(
      env,
      clazz,
      "primitiveArrays",
      "([B[C[S[I[J[F[D)[Z",
      &cached_method_id);
  jni_zero::ScopedJavaLocalRef<jobject> converted_b = jni_zero::ToJniArray(
      env,
      b);
  jni_zero::ScopedJavaLocalRef<jobject> converted_c = jni_zero::ToJniArray(
      env,
      c);
  jni_zero::ScopedJavaLocalRef<jobject> converted_s = jni_zero::ToJniArray(
      env,
      s);
  jni_zero::ScopedJavaLocalRef<jobject> converted_i = jni_zero::ToJniArray(
      env,
      i);
  jni_zero::ScopedJavaLocalRef<jobject> converted_l = jni_zero::ToJniArray(
      env,
      l);
  jni_zero::ScopedJavaLocalRef<jobject> converted_f = jni_zero::ToJniArray(
      env,
      f);
  jni_zero::ScopedJavaLocalRef<jobject> converted_d = jni_zero::ToJniArray(
      env,
      d);
  auto _ret = env->CallStaticObjectMethod(
      clazz,
      call_context.method_id(),
      converted_b.obj(),
      converted_c.obj(),
      converted_s.obj(),
      converted_i.obj(),
      converted_l.obj(),
      converted_f.obj(),
      converted_d.obj());
  return jni_zero::FromJniArray<std::vector<bool>>(
      env,
      jni_zero::ScopedJavaLocalRef<jbooleanArray>(env, static_cast<jbooleanArray>(_ret)));
}

static jboolean Java_SampleForTests_staticJavaMethod(JNIEnv* env) {
  static std::atomic<jmethodID> cached_method_id(nullptr);
  jclass clazz = this_is_a_package_prefix_org_jni_1zero_SampleForTests_clazz(env);
  CHECK_CLAZZ(env, clazz, clazz, false);
  jni_zero::internal::JniJavaCallContext<true> call_context;
  call_context.Init<jni_zero::MethodID::TYPE_STATIC>(
      env,
      clazz,
      "staticJavaMethod",
      "()Z",
      &cached_method_id);
  auto _ret = env->CallStaticBooleanMethod(clazz, call_context.method_id());
  return _ret;
}

static jni_zero::ScopedJavaLocalRef<jobject> Java_InnerStructA_create(
    JNIEnv* env,
    jlong l,
    JniIntWrapper i,
    const jni_zero::JavaRef<jstring>& s) {
  static std::atomic<jmethodID> cached_method_id(nullptr);
  jclass clazz = this_is_a_package_prefix_org_jni_1zero_SampleForTests_00024InnerStructA_clazz(env);
  CHECK_CLAZZ(env, clazz, clazz, nullptr);
  jni_zero::internal::JniJavaCallContext<true> call_context;
  call_context.Init<jni_zero::MethodID::TYPE_STATIC>(
      env,
      clazz,
      "create",
      "(JILjava/lang/String;)Lthis/is/a/package/prefix/org/jni_zero/SampleForTests$InnerStructA;",
      &cached_method_id);
  auto _ret = env->CallStaticObjectMethod(
      clazz,
      call_context.method_id(),
      l,
      as_jint(i),
      s.obj());
  return jni_zero::ScopedJavaLocalRef<jobject>(env, _ret);
}

static jlong Java_InnerStructB_getKey(
    JNIEnv* env,
    const jni_zero::JavaRef<jobject>& obj) {
  static std::atomic<jmethodID> cached_method_id(nullptr);
  jclass clazz = this_is_a_package_prefix_org_jni_1zero_SampleForTests_00024InnerStructB_clazz(env);
  CHECK_CLAZZ(env, obj.obj(), clazz, 0);
  jni_zero::internal::JniJavaCallContext<true> call_context;
  call_context.Init<jni_zero::MethodID::TYPE_INSTANCE>(
      env,
      clazz,
      "getKey",
      "()J",
      &cached_method_id);
  auto _ret = env->CallLongMethod(obj.obj(), call_context.method_id());
  return _ret;
}

static jni_zero::ScopedJavaLocalRef<jstring> Java_InnerStructB_getValue(
    JNIEnv* env,
    const jni_zero::JavaRef<jobject>& obj) {
  static std::atomic<jmethodID> cached_method_id(nullptr);
  jclass clazz = this_is_a_package_prefix_org_jni_1zero_SampleForTests_00024InnerStructB_clazz(env);
  CHECK_CLAZZ(env, obj.obj(), clazz, nullptr);
  jni_zero::internal::JniJavaCallContext<true> call_context;
  call_context.Init<jni_zero::MethodID::TYPE_INSTANCE>(
      env,
      clazz,
      "getValue",
      "()Ljava/lang/String;",
      &cached_method_id);
  auto _ret = env->CallObjectMethod(obj.obj(), call_context.method_id());
  jstring _ret2 = static_cast<jstring>(_ret);
  return jni_zero::ScopedJavaLocalRef<jstring>(env, _ret2);
}


}  // namespace tests
}  // namespace jni_zero
#endif  // this_is_a_package_prefix_org_jni_1zero_SampleForTests_JNI