issue10788.java.golden 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. // Code generated by gobind. DO NOT EDIT.
  2. // Java class issue10788.TestStruct is a proxy for talking to a Go program.
  3. //
  4. // autogenerated by gobind -lang=java issue10788
  5. package issue10788;
  6. import go.Seq;
  7. public final class TestStruct implements Seq.Proxy {
  8. static { Issue10788.touch(); }
  9. private final int refnum;
  10. @Override public final int incRefnum() {
  11. Seq.incGoRef(refnum, this);
  12. return refnum;
  13. }
  14. TestStruct(int refnum) { this.refnum = refnum; Seq.trackGoRef(refnum, this); }
  15. public TestStruct() { this.refnum = __New(); Seq.trackGoRef(refnum, this); }
  16. private static native int __New();
  17. public final native String getValue();
  18. public final native void setValue(String v);
  19. @Override public boolean equals(Object o) {
  20. if (o == null || !(o instanceof TestStruct)) {
  21. return false;
  22. }
  23. TestStruct that = (TestStruct)o;
  24. String thisValue = getValue();
  25. String thatValue = that.getValue();
  26. if (thisValue == null) {
  27. if (thatValue != null) {
  28. return false;
  29. }
  30. } else if (!thisValue.equals(thatValue)) {
  31. return false;
  32. }
  33. return true;
  34. }
  35. @Override public int hashCode() {
  36. return java.util.Arrays.hashCode(new Object[] {getValue()});
  37. }
  38. @Override public String toString() {
  39. StringBuilder b = new StringBuilder();
  40. b.append("TestStruct").append("{");
  41. b.append("Value:").append(getValue()).append(",");
  42. return b.append("}").toString();
  43. }
  44. }
  45. // Code generated by gobind. DO NOT EDIT.
  46. // Java class issue10788.TestInterface is a proxy for talking to a Go program.
  47. //
  48. // autogenerated by gobind -lang=java issue10788
  49. package issue10788;
  50. import go.Seq;
  51. public interface TestInterface {
  52. public void doSomeWork(TestStruct s);
  53. public void multipleUnnamedParams(long p0, String p1, long p2);
  54. }
  55. // Code generated by gobind. DO NOT EDIT.
  56. // Java class issue10788.Issue10788 is a proxy for talking to a Go program.
  57. //
  58. // autogenerated by gobind -lang=java issue10788
  59. package issue10788;
  60. import go.Seq;
  61. public abstract class Issue10788 {
  62. static {
  63. Seq.touch(); // for loading the native library
  64. _init();
  65. }
  66. private Issue10788() {} // uninstantiable
  67. // touch is called from other bound packages to initialize this package
  68. public static void touch() {}
  69. private static native void _init();
  70. private static final class proxyTestInterface implements Seq.Proxy, TestInterface {
  71. private final int refnum;
  72. @Override public final int incRefnum() {
  73. Seq.incGoRef(refnum, this);
  74. return refnum;
  75. }
  76. proxyTestInterface(int refnum) { this.refnum = refnum; Seq.trackGoRef(refnum, this); }
  77. public native void doSomeWork(TestStruct s);
  78. public native void multipleUnnamedParams(long p0, String p1, long p2);
  79. }
  80. }