//
// This file was generated by //third_party/jni_zero/jni_zero.py
//
package org.jni_zero;

import android.graphics.Rect;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.annotation.processing.Generated;
import org.jni_zero.CheckDiscard;
import org.jni_zero.GEN_JNI;
import org.jni_zero.JniTestInstanceHolder;
import org.jni_zero.SampleForTests;
import org.jni_zero.SampleUnderSamePackage;
import org.jni_zero.internal.NullUnmarked;
import org.jni_zero.internal.Nullable;

@CheckDiscard("crbug.com/993421")
@Generated("JNI Zero")
@SuppressWarnings({"rawtypes", "unchecked"})
@NullUnmarked
public class SampleForTestsJni implements SampleForTests.Natives {
  private static @Nullable JniTestInstanceHolder sOverride;

  public static SampleForTests.Natives get() {
    JniTestInstanceHolder holder = sOverride;
    if (holder != null && holder.value != null) {
      return (SampleForTests.Natives) holder.value;
    }
    return new SampleForTestsJni();
  }

  public static void setInstanceForTesting(SampleForTests.Natives impl) {
    if (sOverride == null) {
      sOverride = JniTestInstanceHolder.create();
    }
    sOverride.value = impl;
  }


  @Override
  public void addStructB(long nativeCPPClass, SampleForTests caller, SampleForTests.InnerStructB b) {
    assert nativeCPPClass != 0;
    assert caller != null : "Parameter \"caller\" was null. Add @Nullable to it?";
    assert b != null : "Parameter \"b\" was null. Add @Nullable to it?";
    GEN_JNI.org_jni_1zero_SampleForTests_addStructB(nativeCPPClass, caller, b);
  }

  @Override
  public void classUnderSamePackageTest(SampleUnderSamePackage arg) {
    assert arg != null : "Parameter \"arg\" was null. Add @Nullable to it?";
    GEN_JNI.org_jni_1zero_SampleForTests_classUnderSamePackageTest(arg);
  }

  @Override
  public void destroy(long nativeCPPClass, SampleForTests caller, byte[] bytes) {
    assert nativeCPPClass != 0;
    assert caller != null : "Parameter \"caller\" was null. Add @Nullable to it?";
    assert bytes != null : "Parameter \"bytes\" was null. Add @Nullable to it?";
    GEN_JNI.org_jni_1zero_SampleForTests_destroy(nativeCPPClass, caller, bytes);
  }

  @Override
  public Class getClass(Class env) {
    assert env != null : "Parameter \"env\" was null. Add @Nullable to it?";
    return (Class) GEN_JNI.org_jni_1zero_SampleForTests_getClass(env);
  }

  @Override
  public double getDoubleFunction(SampleForTests ret) {
    assert ret != null : "Parameter \"ret\" was null. Add @Nullable to it?";
    return (double) GEN_JNI.org_jni_1zero_SampleForTests_getDoubleFunction(ret);
  }

  @Override
  public float getFloatFunction() {
    return (float) GEN_JNI.org_jni_1zero_SampleForTests_getFloatFunction();
  }

  @Override
  public Object getNonPODDatatype(SampleForTests jcaller) {
    assert jcaller != null : "Parameter \"jcaller\" was null. Add @Nullable to it?";
    return (Object) GEN_JNI.org_jni_1zero_SampleForTests_getNonPODDatatype(jcaller);
  }

  @Override
  public Throwable getThrowable(Throwable arg0) {
    assert arg0 != null : "Parameter \"arg0\" was null. Add @Nullable to it?";
    return (Throwable) GEN_JNI.org_jni_1zero_SampleForTests_getThrowable(arg0);
  }

  @Override
  public long init(SampleForTests caller, String param, byte[] bytes, SampleForTests convertedType, SampleForTests[] nonConvertedArray) {
    assert caller != null : "Parameter \"caller\" was null. Add @Nullable to it?";
    assert param != null : "Parameter \"param\" was null. Add @Nullable to it?";
    assert bytes != null : "Parameter \"bytes\" was null. Add @Nullable to it?";
    assert convertedType != null : "Parameter \"convertedType\" was null. Add @Nullable to it?";
    assert nonConvertedArray != null : "Parameter \"nonConvertedArray\" was null. Add @Nullable to it?";
    return (long) GEN_JNI.org_jni_1zero_SampleForTests_init(
        caller,
        param,
        bytes,
        convertedType,
        nonConvertedArray);
  }

  @Override
  public void iterateAndDoSomethingWithStructB(long nativeCPPClass, SampleForTests caller) {
    assert nativeCPPClass != 0;
    assert caller != null : "Parameter \"caller\" was null. Add @Nullable to it?";
    GEN_JNI.org_jni_1zero_SampleForTests_iterateAndDoSomethingWithStructB(nativeCPPClass, caller);
  }

  @Override
  public List listTest2(Set items) {
    assert items != null : "Parameter \"items\" was null. Add @Nullable to it?";
    return (List) GEN_JNI.org_jni_1zero_SampleForTests_listTest2(items);
  }

  @Override
  public Map mapTest2(Map arg0) {
    assert arg0 != null : "Parameter \"arg0\" was null. Add @Nullable to it?";
    return (Map) GEN_JNI.org_jni_1zero_SampleForTests_mapTest2(arg0);
  }

  @Override
  public int method(long nativeCPPClass, SampleForTests caller, String[] strings) {
    assert nativeCPPClass != 0;
    assert caller != null : "Parameter \"caller\" was null. Add @Nullable to it?";
    assert strings != null : "Parameter \"strings\" was null. Add @Nullable to it?";
    return (int) GEN_JNI.org_jni_1zero_SampleForTests_method(nativeCPPClass, caller, strings);
  }

  @Override
  public double methodOtherP0(long nativePtr, SampleForTests caller) {
    assert nativePtr != 0;
    assert caller != null : "Parameter \"caller\" was null. Add @Nullable to it?";
    return (double) GEN_JNI.org_jni_1zero_SampleForTests_methodOtherP0(nativePtr, caller);
  }

  @Override
  public boolean[] primitiveArrays(byte[] b, char[] c, short[] s, int[] i, long[] l, float[] f, double[] d) {
    assert b != null : "Parameter \"b\" was null. Add @Nullable to it?";
    assert c != null : "Parameter \"c\" was null. Add @Nullable to it?";
    assert s != null : "Parameter \"s\" was null. Add @Nullable to it?";
    assert i != null : "Parameter \"i\" was null. Add @Nullable to it?";
    assert l != null : "Parameter \"l\" was null. Add @Nullable to it?";
    assert f != null : "Parameter \"f\" was null. Add @Nullable to it?";
    assert d != null : "Parameter \"d\" was null. Add @Nullable to it?";
    return (boolean[]) GEN_JNI.org_jni_1zero_SampleForTests_primitiveArrays(b, c, s, i, l, f, d);
  }

  @Override
  public String returnAString(long nativeCPPClass, SampleForTests caller) {
    assert nativeCPPClass != 0;
    assert caller != null : "Parameter \"caller\" was null. Add @Nullable to it?";
    return (String) GEN_JNI.org_jni_1zero_SampleForTests_returnAString(nativeCPPClass, caller);
  }

  @Override
  public int returnFromEnum() {
    return (int) GEN_JNI.org_jni_1zero_SampleForTests_returnFromEnum();
  }

  @Override
  public void setNonPODDatatype(SampleForTests obj, Rect rect) {
    assert obj != null : "Parameter \"obj\" was null. Add @Nullable to it?";
    assert rect != null : "Parameter \"rect\" was null. Add @Nullable to it?";
    GEN_JNI.org_jni_1zero_SampleForTests_setNonPODDatatype(obj, rect);
  }
}
