github.com/thommil/tge-mobile@v0.0.0-20190308225214-66a08abd51aa/bind/testdata/issue10788.java.golden (about) 1 // Java class issue10788.TestStruct is a proxy for talking to a Go program. 2 // gobind -lang=java issue10788 3 // 4 // File is generated by gobind. Do not edit. 5 package issue10788; 6 7 import go.Seq; 8 9 public final class TestStruct implements Seq.Proxy { 10 static { Issue10788.touch(); } 11 12 private final int refnum; 13 14 @Override public final int incRefnum() { 15 Seq.incGoRef(refnum, this); 16 return refnum; 17 } 18 19 TestStruct(int refnum) { this.refnum = refnum; Seq.trackGoRef(refnum, this); } 20 21 public TestStruct() { this.refnum = __New(); Seq.trackGoRef(refnum, this); } 22 23 private static native int __New(); 24 25 public final native String getValue(); 26 public final native void setValue(String v); 27 28 @Override public boolean equals(Object o) { 29 if (o == null || !(o instanceof TestStruct)) { 30 return false; 31 } 32 TestStruct that = (TestStruct)o; 33 String thisValue = getValue(); 34 String thatValue = that.getValue(); 35 if (thisValue == null) { 36 if (thatValue != null) { 37 return false; 38 } 39 } else if (!thisValue.equals(thatValue)) { 40 return false; 41 } 42 return true; 43 } 44 45 @Override public int hashCode() { 46 return java.util.Arrays.hashCode(new Object[] {getValue()}); 47 } 48 49 @Override public String toString() { 50 StringBuilder b = new StringBuilder(); 51 b.append("TestStruct").append("{"); 52 b.append("Value:").append(getValue()).append(","); 53 return b.append("}").toString(); 54 } 55 } 56 57 // Java class issue10788.TestInterface is a proxy for talking to a Go program. 58 // gobind -lang=java issue10788 59 // 60 // File is generated by gobind. Do not edit. 61 package issue10788; 62 63 import go.Seq; 64 65 public interface TestInterface { 66 public void doSomeWork(TestStruct s); 67 public void multipleUnnamedParams(long p0, String p1, long p2); 68 69 } 70 71 // Java class issue10788.Issue10788 is a proxy for talking to a Go program. 72 // gobind -lang=java issue10788 73 // 74 // File is generated by gobind. Do not edit. 75 package issue10788; 76 77 import go.Seq; 78 79 public abstract class Issue10788 { 80 static { 81 Seq.touch(); // for loading the native library 82 _init(); 83 } 84 85 private Issue10788() {} // uninstantiable 86 87 // touch is called from other bound packages to initialize this package 88 public static void touch() {} 89 90 private static native void _init(); 91 92 private static final class proxyTestInterface implements Seq.Proxy, TestInterface { 93 private final int refnum; 94 95 @Override public final int incRefnum() { 96 Seq.incGoRef(refnum, this); 97 return refnum; 98 } 99 100 proxyTestInterface(int refnum) { this.refnum = refnum; Seq.trackGoRef(refnum, this); } 101 102 public native void doSomeWork(TestStruct s); 103 public native void multipleUnnamedParams(long p0, String p1, long p2); 104 } 105 106 107 }