2
0
mirror of synced 2025-02-23 23:08:14 +00:00
mobile/bind/testdata/issue10788.java.golden
Elias Naur e1840f9c11 mobile/bind: make Java proxy classes private
Proxies are an implementation detail, so make them private to hide
them from the public API.

Also, move the proxy classes out of its interface scope; classes
declared inside Java interfaces are always public and cannot be
declared otherwise. Use the lowercase "proxy" class prefix to
avoid name clashes with exported Go interfaces and structs.

Change-Id: Iae6a53ed4885b7899f2fa770b73c135f54ffb263
Reviewed-on: https://go-review.googlesource.com/21370
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-04-02 13:41:50 +00:00

71 lines
2.2 KiB
Plaintext

// Java class go.issue10788.Issue10788 is a proxy for talking to a Go program.
// gobind -lang=java issue10788
//
// File is generated by gobind. Do not edit.
package go.issue10788;
import go.Seq;
public abstract class Issue10788 {
static {
Seq.touch(); // for loading the native library
init();
}
private Issue10788() {} // uninstantiable
// touch is called from other bound packages to initialize this package
public static void touch() {}
private static native void init();
public static final class TestStruct extends Seq.Proxy {
private TestStruct(go.Seq.Ref ref) { super(ref); }
public final native String getValue();
public final native void setValue(String v);
@Override public boolean equals(Object o) {
if (o == null || !(o instanceof TestStruct)) {
return false;
}
TestStruct that = (TestStruct)o;
String thisValue = getValue();
String thatValue = that.getValue();
if (thisValue == null) {
if (thatValue != null) {
return false;
}
} else if (!thisValue.equals(thatValue)) {
return false;
}
return true;
}
@Override public int hashCode() {
return java.util.Arrays.hashCode(new Object[] {getValue()});
}
@Override public String toString() {
StringBuilder b = new StringBuilder();
b.append("TestStruct").append("{");
b.append("Value:").append(getValue()).append(",");
return b.append("}").toString();
}
}
public interface TestInterface {
public void DoSomeWork(TestStruct s);
public void MultipleUnnamedParams(long p0, String p1, long p2);
}
private static final class proxyTestInterface extends Seq.Proxy implements TestInterface {
proxyTestInterface(Seq.Ref ref) { super(ref); }
public native void DoSomeWork(TestStruct s);
public native void MultipleUnnamedParams(long p0, String p1, long p2);
}
}