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>
71 lines
2.2 KiB
Plaintext
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);
|
|
}
|
|
|
|
|
|
}
|