//
// This file was generated by //third_party/jni_zero/jni_zero.py
//
package org.jni_zero;
import java.util.Map;
import org.jni_zero.CheckDiscard;
import org.jni_zero.GEN_JNI;
import org.jni_zero.JniStaticTestMocker;
import org.jni_zero.NativeLibraryLoadedStatus;
import org.jni_zero.SampleForTests;
import org.jni_zero.SampleProxyEdgeCases;
import org.jni_zero.internal.Boolean;
@CheckDiscard("crbug.com/993421")
class SampleProxyEdgeCasesJni implements SampleProxyEdgeCases.Natives {
private static SampleProxyEdgeCases.Natives testInstance;
public static final JniStaticTestMocker<SampleProxyEdgeCases.Natives> TEST_HOOKS =
new JniStaticTestMocker<SampleProxyEdgeCases.Natives>() {
@Override
public void setInstanceForTesting(SampleProxyEdgeCases.Natives instance) {
if (!GEN_JNI.TESTING_ENABLED) {
throw new RuntimeException(
"Tried to set a JNI mock when mocks aren't enabled!");
}
testInstance = instance;
}
};
@Override
public int addStructB(SampleForTests caller, SampleForTests.InnerStructB b) {
return (int) GEN_JNI.org_jni_1zero_SampleProxyEdgeCases_addStructB(
caller,
b);
}
@Override
public String[][] arrayTypes1(int[] a, Object[][] b) {
return (String[][]) GEN_JNI.org_jni_1zero_SampleProxyEdgeCases_arrayTypes1(
a,
b);
}
@Override
public int[] arrayTypes2(int[] a, Throwable[][] b) {
return (int[]) GEN_JNI.org_jni_1zero_SampleProxyEdgeCases_arrayTypes2(
a,
b);
}
@Override
public void fooForTest() {
GEN_JNI.org_jni_1zero_SampleProxyEdgeCases_fooForTest();
}
@Override
public void fooForTesting() {
GEN_JNI.org_jni_1zero_SampleProxyEdgeCases_fooForTesting();
}
@Override
public void fooForTests() {
GEN_JNI.org_jni_1zero_SampleProxyEdgeCases_fooForTests();
}
@Override
public void foo__weirdly__escaped_name1() {
GEN_JNI.org_jni_1zero_SampleProxyEdgeCases_foo_1_1weirdly_1_1escaped_1name1();
}
@Override
public Map[] genericsWithNestedClassArray(Map[] arg) {
return (Map[]) GEN_JNI.org_jni_1zero_SampleProxyEdgeCases_genericsWithNestedClassArray(
arg);
}
@Override
public void setBool(Boolean b, SampleProxyEdgeCases.Integer i) {
GEN_JNI.org_jni_1zero_SampleProxyEdgeCases_setBool(b, i);
}
@Override
public boolean setStringBuilder(StringBuilder sb) {
return (boolean) GEN_JNI.org_jni_1zero_SampleProxyEdgeCases_setStringBuilder(
sb);
}
@Override
public int setStringBuilder(int sb) {
return (int) GEN_JNI.org_jni_1zero_SampleProxyEdgeCases_setStringBuilder(
sb);
}
public static SampleProxyEdgeCases.Natives get() {
if (GEN_JNI.TESTING_ENABLED) {
if (testInstance != null) {
return testInstance;
}
if (GEN_JNI.REQUIRE_MOCK) {
throw new UnsupportedOperationException(
"No mock found for the native implementation of SampleProxyEdgeCases.Natives. "
+ "The current configuration requires implementations be mocked.");
}
}
NativeLibraryLoadedStatus.checkLoaded();
return new SampleProxyEdgeCasesJni();
}
}